Hi all... I have to use a select box with multiple selection capability. Also i have to retrieve the selected items from the controller. I used select_tag. But while retrieving the value i don''t get anything in the controller Please help. Thanks Suneeta -- 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 -~----------~----~----~----~------~----~------~--~---
It works fine for me. On Sat, May 10, 2008 at 3:13 AM, Suneeta Km < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi all... > > I have to use a select box with multiple selection capability. Also i > have to retrieve the selected items from the controller. > > I used select_tag. But while retrieving the value i don''t get anything > in the controller > > Please help. > > Thanks > Suneeta > -- > Posted via http://www.ruby-forum.com/. > > > >-- James Mitchell --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Suneeta Km wrote:> I have to use a select box with multiple selection capability. Also i > have to retrieve the selected items from the controller. > > I used select_tag. But while retrieving the value i don''t get anything > in the controllerThe two tricks are... select_tag ''my_records[]'', ... :multiple => :multiple The [] is a trick that helps a form pass an array of results, and your <select> HTML needs the multiple="multiple" attribute. Post your code if you get stuck! -- Phlip --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---