I have 2 tables one is the parent one is the child structured like this:
companies
id
company_name
company_locations
id
company_id
I want to pull a list of specific company locations
when I list the data I can use.. :company_location.company.company_name - no problem
what I want to do is order the list by company_name.
I'm using pagination, heres the line of code:
@company_locations_pages, @company_locations = paginate :company_location, :per_page => 25, :conditions => 'host_flag = 1', :order => :company_location.company.company_name
the order clause is failing. All the example of using :order look something like :order => 'field_name' - but the field i want to use is not in the same table, so that isn't working
any help would be appreciated