私はこのクラスを持っています:
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で並べ替える方法は?