I have a PaymentDetail model with attribute \'home_address_country\', so i can use
@payment_detail.home_address_country //where @payment_detail is object
Recommended way for Rails 3 is to use dictionary-like access:
attr = @payment_detail["#{address_type}_address_country"] attr = "new value" @payment_detail["#{address_type}_address_country"] = attr
read_attribute and write_attribute methods work for Rails 2 only.
read_attribute
write_attribute