[Rails] Re: difference between attr_accessor and attr_accessible?

2011-03-07 Thread Tim Shaffer
This is mass assignment: User.new(params[:user]) Basically assigning all the attributes to the an instance based on the params[:user] hash. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrail

[Rails] Re: difference between attr_accessor and attr_accessible?

2011-03-07 Thread Gaba Luschi
Thanks - what's mass assignment? Assigning attributes to an object? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To un

[Rails] Re: difference between attr_accessor and attr_accessible?

2011-03-07 Thread Frederick Cheung
On Mar 7, 4:45 pm, Gaba Luschi wrote: > Hi, > > What's the difference between attr_accessor and attr_accessible? > They're completely unrelated. attr_accessor is a pure ruby method and creates a setter & getter method for an instance variable. attr_accessible (and its counterpart attr_protected