Forum: Ruby on Rails group by?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
rosoft2001 (Guest)
on 2007-05-11 07:36
(Received via mailing list)
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
Camo (Guest)
on 2007-05-11 09:36
(Received via mailing list)
Hey there mate,

Go to railscast.com i think there is a quick 4 min viedo on it, that
should help
Alain R. (Guest)
on 2007-05-11 14:39
(Received via mailing list)
You just sent him to a spam search page :(

Correct url:

    http://railscasts.com/episodes/29


Alain R.
--------
blog.ravet.com/
Scott (Guest)
on 2007-05-12 01:44
(Received via mailing list)
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
Cliff R. (Guest)
on 2007-05-12 12:05
(Received via mailing list)
> 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 topic is locked and can not be replied to.