Forum: Ruby on Rails Pagination + pretty URLs

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Jeff J. (Guest)
on 2006-03-05 22:31
Hello all.

I want to make pagination URLs pretty instead of the ?page=2. I have
written a route like this:

  map.connect 'restaurant/list_dishes/:page',
    :controller => 'restaurant',
    :action => 'list_dishes',
    :requirements => { :page => /\d+/},
    :page => nil

Which appears to work. However the following only retrieves the first 10

def list_dishes
   @dish_pages, @dishes = paginate :dishes, :conditions => "visible =
TRUE", :per_page => 10

Now there is no explicit page list there but the fact it works without
the above route means there must be some magic going on that I now need
to make manual. What I don't know is what needs to be changed? Any

This topic is locked and can not be replied to.