Thanks! I think that would be one way to do it, but I was having
issues retrieving the result of the query from the session. What I
really wanted to do was store just the query itself into a session
variable.
The main problem I was having was that if I stored my find parameters
as as string, this find function was reading the strings instead of
the symbols.
Anyway...what I ended up doing was storing the queries as a SQL
statement instead of hash symbols. They using the function
find_by_sql instead of find.
For instance:
sql_query = "SQL STATEMENT"
session[:sql_query] = sql_query (not sure if this session is available
immediately after creation, so I stored it in a separate step)
@device = Device.find_by_sql(sql_query)
Now if another action wanted to be dynamic and use the results from
the prior action, it would use:
@device = Device.find_by_sql(session[:sql_query])
I'm sure there is a more elegant way to do this (and I would still be
interested to know), but this works for my purpose.
Well you;ve got to decide what you're storing. for example
for example
session[:query_string] = [:all, {:order => 'rack_number asc,
rack_position desc'}]
would work fine.