Hi I have this kind of problem. I have table called item and there is column called priority. So i have to do select tag for priority. <td><b>Priority: </b></td> <% @item.priority = 3 %> <td><%= select_tag "item","priority",[1,2,3,4,5] %></td> it gives an error undefined method `stringify_keys'' for [1, 2, 3, 4, 5]:Array Any ideas how to solve that ? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
as you use it, you''re most likely confusing select and select_tag to make the options from an array use options_from_collection_for_select you''ll find the details here: http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html#M001749 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks. On 3 heinä, 16:22, Thorsten Müller <thors...-1oxKqHKwyltBDgjK7y7TUQ@public.gmane.org> wrote:> as you use it, you''re most likely confusing select and select_tag > to make the options from an array use > options_from_collection_for_select > > you''ll find the details here:http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelp...--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---