attr_accessor :variable_name # this will generate get and set method
If you meant how to write get & set methods for database table column in
read_attribute(:column_name) # if column_name is the name of the
write_attribute(:column_name, value) # or you can modify value, and
call super with it. Search on Internet to find more.
On Wed, Sep 9, 2009 at 2:33 PM, Venkat E.
On Sep 9, 10:15Â am, Abhinav S. [email protected] wrote:
Â attr_accessor :variable_name Â # this will generate get and set method for
But don’t do this for database backed attributes - for those the
accessor methods are added for you.