diff --git a/README.rdoc b/README.rdoc index 709960a..c8d030c 100644 --- a/README.rdoc +++ b/README.rdoc @@ -271,6 +271,14 @@ Because of the +page+ parameter and Rails 3 routing, you can easily generate SEO get 'page/:page', :action => :index, :on => :collection end +If you are using Rails 4 or later, you can simplify route definitions by using `concern`: + + concern :paginatable do + get '(page/:page)', :action => :index, :on => :collection, :as => '' + end + + resources :my_resources, :concerns => :paginatable + This will create URLs like /my_resources/page/33 instead of /my_resources?page=33. This is now a friendly URL, but it also has other added benefits... Because the +page+ parameter is now a URL segment, we can leverage on Rails page caching[http://guides.rubyonrails.org/caching_with_rails.html#page-caching]!