Hi everyone,

I have GroupDocument model with following fields:
  belongs_to :group
  belongs_to :document
  enum_attr :status, %w(pending approved banned)

Document has fields like 'title' or 'author'. On controller index I
do:

    @group_documents =
GroupDocument.find_all_by_group_id(params[:group_id]).paginate :page
=> params[:page], :per_page => 10, :order => '?'

Problem is with order. I want to return @group_documents collection
ordered by document.title. Something like
:order => 'group.title asc'

How is it possible?

Cheers Alex

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to