I would like to show a variable (which is actually a List) as part of f.select(..) function in Rails3.2, so that the selected value is stored in a different attribute in the ActiveRecord object. How do I declare the above List variable as a transient variable in ActiveRecord, so that ActiveRecord doesn’t try to store this.
Share
You can write your own getter and setter methods in the model like this (don’t forget to add it to attr_accessible):
or just create an alias for the real attribute, like this: