Dynamically get Object's attribute

后端 未结 3 1943
失恋的感觉
失恋的感觉 2021-02-07 13:09

How do I dynamiclly get an attribute value for an activerecord object?

for example I have a variable named attr_name.
I want to do something like this

3条回答
提交回复
热议问题