文字列でActiveRecordの属性を取得する方法

toshihiko150toshihiko150 のブックマーク 2013/05/21 17:06

その他

このブックマークにはスターがありません。
最初のスターをつけてみよう!

get attribute of ActiveRecord object by string

    It is probably a really simple thing but can't find a solution. I have an ActiveRecord object and want to get an attribute like this: attribute_name = "name" user = User.find(1) user.get_attribute_...

    \ コメントが サクサク読める アプリです /

    • App Storeからダウンロード
    • Google Playで手に入れよう