Make the select box submit params[:per_page] (name="per_page")
onChange. You''ll also want it to go back to the first page
(params[:page] = 1) or else you could request an invalid page (e.g.,
there is no page 7 at 50 items per page when you only have 100 items,
even if you were on page 7 when viewing 10 items per page). Pass
per_page and page to the paginate call.
-Kyle
On Apr 23, 6:53 am, Adriano Lul
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> I want to pass the number of pages in a select box (10,15,25,50) and
> when I press some button or just doing the action (observer_field?) it
> will change the pagination, how can i do it ?
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---