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
attr_name
Either use person.attributes[attr_name] or person.read_attribute(att_name), or even shorter then this is person[attr_name].
person.attributes[attr_name]
person.read_attribute(att_name)
person[attr_name]