Hey people, I was wondering if there''s an easy way in rails to have select dropdowns keep the option that was selected before a search is performed. According to someone I work with it is possible to do this in an easy way in rails, so I hope anyone can point me in the right direction... Many thanks, Danny -- 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 -~----------~----~----~----~------~----~------~--~---
I''m just guessing here but sounds like sessions or cookies, probably sessions, is the key. Anyone got experience with this? I dunno myself. RSL On 3/14/07, Daniel Owen van Dommelen <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Hey people, > > I was wondering if there''s an easy way in rails to have select dropdowns > keep the option that was selected before a search is performed. > According to someone I work with it is possible to do this in an easy > way in rails, so I hope anyone can point me in the right direction... > > Many thanks, > > Danny > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Russell Norris wrote:> I''m just guessing here but sounds like sessions or cookies, probably > sessions, is the key. Anyone got experience with this? I dunno myself. > > RSL > > On 3/14/07, Daniel Owen van Dommelen <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>Yes, this options, while it''s probably possible to go this way, I would really like to find a cleaner method to do so. The problem is that the selects are generated using rails helper methods and the options are automatically generated from arrays defined in application_helper.rb. This makes it so I can''t use a for loop or whatever to check if the current <option> equals the stored session/cookie data... I am SO sure rails must have thought of this before... thanks anyway though... -- 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 -~----------~----~----~----~------~----~------~--~---