我有这个课程:
class Fruit
attr_accessible :name, :position
has_many :apples
default_scope order('position ASC')
end
class Apple
attr_accessible :name
belongs_to :fruit
end
如何按fruit.position对苹果进行排序?
我有这个课程:
class Fruit
attr_accessible :name, :position
has_many :apples
default_scope order('position ASC')
end
class Apple
attr_accessible :name
belongs_to :fruit
end
如何按fruit.position对苹果进行排序?