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)
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.