|
|
|
|
|
by tptacek
5251 days ago
|
|
All I can say is, I looked under the hood at the application we're talking about and thought these might be useful suggestions. Particularly attr_accessible. I've found a lot of Rails apps over the last couple years that were diligent about having an attr_accessible in every model, but not diligent about what went in the attr_accessible. Following the Rails idiom, they were doing all their attribute assignment through update-style params[:model] model[foo] model[bar] stuff, and attr_accessible "breaks" that. The Rails tutorial is good (and ambitious) --- just know, this stuff trips up solid, experienced Rails developers all the time. |
|
I think "mass assignment" and "attr_accessible" in tutorials should always link to the API documentation[1] that explains the implications and the tools at your disposal + example code.
[1]: http://api.rubyonrails.org/classes/ActiveModel/MassAssignmen...