Hi, I have been tweaking my index view in order to narrow down the amount of data displayed. The obvious first step was to add will-paginate, but then I added a couple of select boxes to narrow things down a bit more based on categories. Somewhere in the midst of all of this I discovered the way cool feature of named routes that allows me to pass parameters into the named route. So I am using things like new_document_path(:category => @category, :prefix => @prefix) in order to pass the values of @category and @prefix from my "index" view into my "new" view. I am trying to do the same thing with the named route in a form (i.e. form_for (document_path(:prefix => @prefix, ;category => @category, :page => @page) ...) and am running into some problems. It may be the case that I cannot use this feature for the #create action. I''m not sure yet. But as I''ve started thinking about this I''ve started to wonder if I''m going down the best path. Would it make more sense to store @prefix, @category, @page, and whatever else I think I might want to pass around in the session? Or should I keep going down this route? I should point out that the purpose of these parameters is solely to narrow down the number of items displayed. They don''t affect anything other than the view the user sees as (s)he navigates back and forth between the #index view, the #new view, the #index view for some other controller etc... --wpd --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Any one have any thoughts on this one? Thanks --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thomas R. Koll
2009-Feb-01 23:56 UTC
Re: Using session variables vs passing parameters via URL
Hi Patrick, Session variables are awefull, please don''t use them. Just think of a user passing the url to another user expecting that the other will see the same content but with weird session variables that wouldn''t happen. ciao, tom On Dec 22 2008, 6:01 pm, "Patrick Doyle" <wpds...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Would it make more sense to store @prefix, @category, @page, and whatever > else I think I might want to pass around in the session? Or should I keep > going down this route?-- Thomas R. "TomK32" Koll <> http://ananasblau.com just a geek trying to change the world http://github.com/TomK32 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---