derekcroft / zable

HTML table generation with searching and sorting made dead simple

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Per-page setting link helper

joekur opened this issue · comments

I think we should have some kind of helper to help with generating links that change the setting for how many items per page, ex: "10 per page", "20 per page", "show all". This link would maintain search and sort status, revert to page 1, and set the page[size] attribute to some number.

Maybe something like this:

link_to "10 per page", set_page_size_path(10)
link_to "show all", set_page_size_path(99999) # or maybe set_page_size_path(nil)

I like it. This fits in nicely with the cleanup you've done to the per_page stuff in general.