How can I use virtual attributes(getter, setter) in rails 4, as 'attr_accessible' removed.
I am getting issue, here
def tags_list
@tags = self.tags.collect(&:name).join(', ')
end
I can reach above method, but not able to reach setter below, when trying to update/create.
def tags_list=(tags)
@tags = tags
end
@tags
, generally instance attributes with same name as getter are used by active record,@tags_list
might be a better choice. – Crankyprotected
methods. Theattr_accessible
method has been deprecated because parameter validation is now done in the controller. – Sanford