Hash#eachRuby のように Active Record データ オブジェクトを列挙したいのですが、可能ですか?
1 に答える
6
個々のオブジェクトにはそれぞれアクセス可能がありますattributes:
model.attributes.each do |attribute, value|
# ...
end
于 2012-04-10T02:15:29.420 に答える
個々のオブジェクトにはそれぞれアクセス可能がありますattributes:
model.attributes.each do |attribute, value|
# ...
end