Attr_accessible vs. attr_reader

I got another question - what is difference between attr_accessible
and attr_reader?

I am not too smart from google’s results (
http://www.google.com/search?q=“attr_accessible”+“attr_reader”
), so I ask here.

When should I use atr_accessible and when attr_reader?

On 4/29/07, running idiot [email protected] wrote:

I got another question - what is difference between attr_accessible
and attr_reader?

I am not too smart from google’s results (
http://www.google.com/search?q=“attr_accessible”+“attr_reader”
), so I ask here.

When should I use atr_accessible and when attr_reader?

attr_reader and attr_accessor are ruby methods:

http://ruby-doc.org/core/classes/Module.html#M001702
http://ruby-doc.org/core/classes/Module.html#M001703

attr_accessible and attr_protected are for ActiveRecord only:

http://rails.rubyonrails.org/classes/ActiveRecord/Base.html#M001006


Rick O.
http://lighthouseapp.com
http://weblog.techno-weenie.net
http://mephistoblog.com

well, thank you. I understand these four models theoretically, but
in fact it works quite strange and is quite chaotic. Or I have
mistakes in different places, but I don’t want to fill this list with
useless pieces of my not-working code :slight_smile:

Thanks anyway!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs