I have my list view filtering rows shown within the table
most of the introductory tutorials do. As I’m adding a few dozen entries
I’m noticing the standard scaffolding pagination doesn’t pick up the
number of rows from the filter since it is not being passed the number
of rows returned within the scope of the filter statement.
From a tactical point I’m wondering if there’s a proper way to approach
this. Should I move my row filter statements into a a method within a
helper that can then be called at top of the list view for the entire
page? Or perhaps separate partial view files should be used with
different filter statements at top of each? Or perhaps there’s someother
way I’m not seeing right off.
I’m imagining the pagination link_to’s will need to include the filter
variables so they are persistent also. So ":s => “Summer”, :c =>
“Beverage”, :t => “Cold” creates urls with added
“?s=Summer&c=Beverages&t=Cold” for example. Is there a prettier way to
persist the variables? Maybe iterate through possible #? of params
within the method?