Basically I’m trying to add the following functionality to a controller
when browsng data
change numbers of rows
for that, I need to save the state of a controller, that is, the current
order, the number of rows, the filter condition, etc.
So far now, I’m saving them to the session.
I have a load method, which loads the data from params, or assing
Something like this
@order = session[:order] || ‘date desc’
@order = params[:order] if params[:order]
And then I have another method to save the data
session[:order] = @order
The problem is that for every method I have to execute “load” do some
stuff and then execute “save”
@resolucion_pages, @resoluciones = paginate :resolucion, :order =>
@order, :per_page => 10
Is there some way to automatize this?
I tried with the initialize method, but it seems like the session is not
available on that method.