Robert Boone said:> Hello,
>
> How do I order by a related table? I tried this:
> LinkHeader.find(1).links :order => ''name''
> But that doesn''t seam to be correct. What am I doing
> wrong.
>
Is this something that you would consider a list?
If so, look at acts_as_list
Let''s say that you have customers and they have wishlists. They might
want
to reorder their list. So, we add a ''position'' field to the
wish_lists
table and add acts_as_list into our model:
class WishList < ActiveRecord::Base
belongs_to :customer
acts_as_list :scope => :customer
end
Acts as List documentation:
http://rubyurl.com/X07pd
Cheers,
Robby
--
/******************************************************
* Robby Russell, Owner.Developer.Geek
* PLANET ARGON, Open Source Solutions & Web Hosting
* Portland, Oregon | p: 503.351.4730 | f: 815.642.4068
* www.planetargon.com | www.robbyonrails.com
*******************************************************/