Why is attr_accessor necessary in Rails?

Viewed 19104

I occasionally see attribute accessors/readers/writers in the code for models. Are these necessary if I want to be able to update attributes from the view / controller code?

I am a beginner so I am really talking about basic applications.

4 Answers

Generally, i use attr_accessor for attributes that is not in model/database, but i think it's not necessary using them.

Related