Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I include blank field in select_tag?

Is it possible to add an option like :include_blank => 'Please Select' in a method select_tag like it is possible with the select method? It seems not to work. Is there any substitute for this for select_tag method?

like image 486
user235195 Avatar asked Dec 21 '09 22:12

user235195


1 Answers

In Rails 3 there is a :prompt option for select_tag:

select_tag "things", many_thing_as_options, :prompt => "Please select" 
like image 194
maro Avatar answered Oct 04 '22 11:10

maro