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
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
feature of named routes that allows me to pass parameters into the named
route. So I am using things like new_document_path(: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) …) and am running into some problems. It may be the case that
cannot use this feature for the #create action. I’m not sure yet. But
I’ve started thinking about this I’ve started to wonder if I’m going
the best path.
Would it make more sense to store @prefix, @category, @page, and
else I think I might want to pass around in the session? Or should I
going down this route?
I should point out that the purpose of these parameters is solely to
down the number of items displayed. They don’t affect anything other
the view the user sees as (s)he navigates back and forth between the
view, the #new view, the #index view for some other controller etc…