I'll answer my own question, incase anyone needs it in the future. This works, and actually has the side effect of clearing the current page on a re-sort (which I feel is better behavior).
Add the following hack (it certainly feels hackish) in a before filter: params[:page] ||= 1 This way, if an action includes a page in the params (like using the paginator), it will be respected. If not, the page will be reset. On Dec 21, 1:16 pm, mobilemike <[email protected]> wrote: > I have a number of hard-coded links to named routes in my application. > This named routes affect filters used in the returned list view. In > effect, I've partly un-ajaxified AS so that I have more control over > what gets displayed. I have come across an issue when someone does the > following: > > Bring up the default view which has no finder conditions applied, this > view is something like 18 pages long. > Move forward through the pages to page 4. > Use a link on the page to move to a filtered version of the data, one > that has less pages. > Since AS remembers that they were on page 4, but this list is only 2 > pages long, I get a nil object error from the AS do_list method. > > So, in my controller I run a before filter for updating the > table_config. I figure I could add something here that clears out the > page setting, but I'm not sure what to do. > > - Mike Karolow -- You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en.
