I m new to ruby language. difference between att_accesor and
attr_accessible is not clear to me.
thanks for your kind help.
kp
(india)
I m new to ruby language. difference between att_accesor and
attr_accessible is not clear to me.
thanks for your kind help.
kp
(india)
On Dec 21, 12:20pm, kp [email protected] wrote:
I m new to ruby language. difference between att_accesor and
attr_accessible is not clear to me.
They’re almost completely unrelated. attr_accessor is part of ruby
itself and is equivalent to calling attr_writer and attr_reader for
the same argument(s), ie it creates accessor methods for you
attr_accessible is a rails thing and is part of rails’ mass assignment
protection (along with attr_protected). It allows you to setup a
whitelist of attributes that can be mass-assigned (as opposed to
attr_protected, which sets up a blacklist) so that users can’t set
important attributes they’re not supposed to be able to set just by
manipulating the form data that is posted
Fred
hey…thanks for help.
On Tue, Dec 21, 2010 at 7:07 PM, Frederick C. <
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs