ruby on rails - RoR - Select tag with include_blank disable -
i want result :
<select dir="rtl"> <option selected disabled>choose car</option> <option value="volvo">volvo</option> <option value="saab">saab</option> <option value="mercedes">mercedes</option> <option value="audi">audi</option> </select>
with following code can end :
<%= f.select(:car, xxxxxx, {:include_blank => 'choose car', :disabled => 'choose car'}) %>
=>
<select id="xxx" name="xxx"> <option value="">choose car</option> <option value="volvo">volvo</option> <option value="saab">saab</option> <option value="mercedes">mercedes</option> <option value="audi">audi</option> </select>
the first option not disabled...
i believe looking below:
<%= f.select(:car, xxxxxx, {:include_blank => 'choose car', :disabled => 1}) %>
Comments
Post a Comment