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

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -