Forum: Ruby on Rails Pagination + pretty URLs

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C728d93eb5205cf20cac0c2928b0ad62?d=identicon&s=25 Jeff Jones (Guest)
on 2006-03-05 21: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
records.

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

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
advice?

Thanks
This topic is locked and can not be replied to.