How can you add an "group by title" clause to:
@books_pages, @books = paginate (:books, :conditions => ['keyid = ?', @key.id], :order => 'id DESC', :per_page => 10 )
Thanks
How can you add an "group by title" clause to:
@books_pages, @books = paginate (:books, :conditions => ['keyid = ?', @key.id], :order => 'id DESC', :per_page => 10 )
Thanks
Hey there mate,
Go to railscast.com i think there is a quick 4 min viedo on it, that should help
If I am not mistaken, with pagination you should be able to use all the parameters that you would on a find. So you could use the :group option.
@books_pages, @books = paginate (:books, :conditions => ['keyid = ?', @key.id], :order => 'id DESC', :per_page => 10, :group => "title" )
Scott
Just watched a few of the railscasts. Most productive 20 minutes I've spent in the past 2 weeks