Nik B
2008-May-30 22:08 UTC
Parameters for FormOptionsHelper select vs. FormTagHelper select_tag
I must be missing something when it comes to the parameter differences between form FormOptionsHelper select and FormTagHelper select_tag. Code that follows, works perfectly - <%= f.select :unit, units_to_select(@product), :size=>"20"%> The following code, does not. The helper function never even seems to be called. <%= select_tag "unit", units_to_select(@product) %> Why would this be the case? The only way I can seem to populate the select_tag is to hardcode with "<option>..." Thanks, Nik --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-May-30 22:18 UTC
Re: Parameters for FormOptionsHelper select vs. FormTagHelper select_tag
On May 30, 11:08 pm, Nik B <nikbau...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I must be missing something when it comes to the parameter differences > between form FormOptionsHelper select and FormTagHelper select_tag. > > Code that follows, works perfectly - > > <%= f.select :unit, units_to_select(@product), :size=>"20"%> >select expects an array of options (which can be in a variety of formats> The following code, does not. The helper function never even seems to > be called. > > <%= select_tag "unit", units_to_select(@product) %> >select_tag expects the actual html <option>... tags options_for_select & options_from_collection_for_select can produce these for you (the latter is closest in usage to select). Fred> Why would this be the case? The only way I can seem to populate the > select_tag is to hardcode with "<option>..." > > Thanks, > Nik--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 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 -~----------~----~----~----~------~----~------~--~---