Friday, January 7, 2011

[Rails] Re: prompt for select_tag.

select_tag does not support prompt, as you have found.

Easiest workaround is probably to just prepend the option manually:

<%= select_tag(:sector_admin_select, "<option>All</option>" + options_from_collection_for_select(@sectors, :id, :name, @sector)) %>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate