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_by_name(attribute_name) => "John"
Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…