Re:Chapter 6 of the Rails Tutorial, 2nd Edition is out ("Mod...
by snprbob86 on Friday January 27, 2012 @08:50PM
(#3521069)
`except` is a bad idea because it's a black-list, but what's wrong with using `slice` as a white-list?
(Anyway, I just grepped our code and there is only ONE usage of slice in a controller anyway, the rest are explicit, non-mass assignments)
I agree with you, though. Model-level attr_accessible, if nothing else, is flatly annoying. I feel inconvenienced by a measure that's supposed to protect against malicious users. And I feel like the terrorists have already won. I'm no MVC guru, but it makes sense to me that the Controller would deal with what amounts to the params that are on their way to the model. Why should the model have to worry about mass assignment?