The more recent kaminari gem can be used in Rails 3. You can refer https://github.com/amatsuda/kaminari
it is very simple to use.
Put this line in your Gemfile:
Typically, your controller code will look like this:
it is very simple to use.
Put this line in your Gemfile:
gem 'kaminari'
Then do bundle installTypically, your controller code will look like this:
@users = User.order(:name).page params[:page]
On the views Just call the paginate helper:<%= paginate @users %>
Now you can see the paginated result..
No comments:
Post a Comment