We Recommend

The Rails Way The Rails Way
Now, for the first time, there’s a comprehensive, authoritative guide to building production-quality software with Rails. Pioneering Rails developer Obie Fernandez and a team of experts illuminate the entire Rails API, along with the Ruby idioms, design approaches, libraries, and plug-ins that make Rails so valuable.


Posted By

winson on 04/30/07


Tagged

list textmate controller book


Versions (?)


Who likes this?

3 people have marked this snippet as a favorite

bordalix
stainless
exscape


Paginate with sort by


Published in: Rails 


  1. def list
  2. @page_title ='List books'
  3. # Good job!
  4. sort_by = params[:sort_by]
  5. @book_pages, @books = paginate :books, :order => sort_by, :per_page => 10
  6. end

Report this snippet 

You need to login to post a comment.