Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to disable select option in rails?

<%=f.select :action_item_status,action_item_status%>  

How can i disable all the option in this select option.

like image 570
Sumeru Suresh Avatar asked Jun 16 '10 16:06

Sumeru Suresh


2 Answers

<%= f.select :action_item_status, action_item_status, {}, {:disabled => true} %>  
like image 67
Ju Nogueira Avatar answered Sep 29 '22 18:09

Ju Nogueira


f.select :action_item_status, action_item_status, {}, disabled: true 

As I cant comment to the last comment, your mistake is, that disabled has to be in the fourth not the third param.

So make sure you add a empty one!

like image 44
Markus Andreas Avatar answered Sep 29 '22 17:09

Markus Andreas