Hi, I’m building an application that have many types of search requests
like simple search, search within results, sort results, sort the
displaying fields, show/hide fields…
To do this I’m using several params[:X] variables which I’m passing all
the time from one method to another.
I’m passing those params with GET (through the URL) wich I don’t like at
which would be a better way to do it insteaf of GET?. And
is there an automated way to pass all the params (or the ones I’d
choose) from one request to another?
You can store all those variables in a session variable. Sessions
allow you to store variables between requests, and give you ‘state’.
Yes, sessions give you ‘state’ which is the best approach for
applications like a shopping cart. However, session is not good for me
(I think) because the users of my application may use more than one
navigation window and I don’t want ‘state’ between them, wich will
happen if I use sessions.
You can use flash (ie. flash[:my_variable] = my_data) to pass
information from one action to the next. Be careful how you use it. I
have ran into some problems passing variables back to the same action
using different request methods.
On Mar 30, 10:35 am, Fernando P. <rails-mailing-l…@andreas-
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.