Al
2006-Oct-25 21:44 UTC
Help with a select_tag; getting an undefined method `stringify_keys'' error
Hi, I''m trying to use a select_tag in the following manner: <%= select_tag(:received_at, @select_dates, String(params[:received_at]) ) %> But I get this error: undefined method `stringify_keys'' for "":String Removing the third parameter eliminates the error, but I was hoping that the drop-down list will select whichever string in the drop-down list matches params[:received_at]. Thanks in advance! -Al --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Al
2006-Oct-26 20:30 UTC
Re: Help with a select_tag; getting an undefined method `stringify_keys'' error
For the benefit of someone searching through this list, my implementation of the below was wrong. I needed to use options_for_select(). So, it should have been: <%= select_tag(:received_at, options_for_select(@select_dates, @params[:received_at])) %> On 10/25/06, Al <broohaha-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I''m trying to use a select_tag in the following manner: > > <%= select_tag(:received_at, @select_dates, String(params[:received_at]) ) %> > > But I get this error: > > undefined method `stringify_keys'' for "":String > > Removing the third parameter eliminates the error, but I was hoping > that the drop-down list will select whichever string in the drop-down > list matches params[:received_at]. > > Thanks in advance! > > > -Al >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---