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
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
Correct url:
http://railscasts.com/episodes/29
Just watched a few of the railscasts. Most productive 20 minutes I’ve
spent
in the past 2 weeks
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs