In Rails, what is the difference between attr_accessor and attr_accessible? From my understanding, using attr_accessor is used to create getter and setter methods for that variable, so that we can access the variable like Object.variable or Object.variable = some_value.

I read that attr_accessible makes that specific variable accessible to the outside world.
Can someone please tell me whats the difference

6 Answers
6

Leave a Reply

Your email address will not be published. Required fields are marked *