Omar Hughes
2012-Jul-18 16:25 UTC
select and collection_select :include_blank option doing different things in rails 3.2.6
Not sure if this is intended, but this threw me off a bit especially being
new to Rails. This applies to both select_tag and select (when tied to an
object)
=select_tag(''test'', options_for_select((1..3).to_a),
:include_blank =>
"test")
yields this:
<option value=""></option>
=select_tag(''test'', options_for_select((1..3).to_a), :prompt
=> "test")
gives this
<option value="">test</option>
A collection_select however, will give the same result whether it''s
:include_blank or :prompt
=collection_select(:car, :make, Make.all, :id, :name, {:include_blank =>
''-
Make -''})
<option value="">- Make -</option>
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/9GLJ1gkm5MYJ.
For more options, visit https://groups.google.com/groups/opt_out.