Hi
Can anyone tell me when i should be using the different select helpers
select(object, method, collection, options = {}, html_options = {})
select_tag(name, option_tags = nil, options = {})
collection_select(object, method, collection, value_method, text_method,
options = {}, html_options = {})
Is that all of them? I understand the advantages of using
collection_select over the others, as it allows me to pass in a hash,
but other than that, the whole thing confuses me.
Thanks
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Pingu Penguin wrote:> Can anyone tell me when i should be using the different select helpers > > select(object, method, collection, options = {}, html_options = {}) > > select_tag(name, option_tags = nil, options = {})Use the first when @object is an instance of an Active Record model. It automatically sets a suitable name attribute for posted parameters, and also automatically selects the current value of @object.method. Use the second for full custom control over the name and selected value. -- We develop, watch us RoR, in numbers too big to ignore. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---