私はこれらのクラスを持っています:
class Product
attr_accessible :name, ...
has_many :images
end
class Image
attr_accessible :image, :position, :product_id, :title
belongs_to :product
end
アクション:
def list
render :json => {:Result => "OK", :Records => Product.all}
end
製品のすべての属性を列挙せずに、ネストされた属性としてすべての製品の独自の画像を含めるにはどうすればよいですか?