On Jan 14, 2:51 pm, Robert Walker <[email protected]> wrote: > Robert Walker wrote: > I'm surprised that those values would be coming though the params hash > at all (as shown in your example). I would expect that the protected > attributes would be set in a more direct manner, but I haven't fully > thought this through. > > I can't think of the benefit of having :name and :email as protected > attributes and then take them from user input. What's the benefit over > allowing them though mass assignment? It appears to me that your code is > replacing mass assignment with another form of mass assignment.
Part of the problem with the current mass assignment is that it's rather crude - eg you might want an attribute to be changeable at creation time only, or only by users with certain privileges etc, or mass assigned with values from a (trusted) file, distinctions which attr_protected / attr_accessible don't allow you. I think there was talk of overhauling this in rails 3, not sure how far that discussion got Fred > -- > Posted viahttp://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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

