Group by?


#1

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


#2

Hey there mate,

Go to railscast.com i think there is a quick 4 min viedo on it, that
should help


#3

You just sent him to a spam search page :frowning:

Correct url:

http://railscasts.com/episodes/29

Alain R.

blog.ravet.com/


#4

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


#5

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 :slight_smile: