Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm a just a fool with a simple Rails app and copy of _The Design of Everyday Things_, but this seems like a usability issue.

The default scaffolding doesn't contain an attr_accessible property, so it's not visible to the user that there's something missing. There's also no feedback from Rails that your attributes are insecure; only feedback if one tries to change an attribute explicitly made non-accessible. Figuring out which attributes must be private is a problem possibly beyond the scope of core Rails, though.

Perhaps a command like `rake routes` for publicly accessible model attributes might be of benefit.



On top of that, Rails sometimes seems like it goes out of it's way to make attr_accessible a pain to use. I know more than once on my team someone has spent more than a few minutes trying to figure out why a model wasn't updating before they remembered to add a property to attr_accessible. In one case, we had a (rarely-used) field uneditable for a few weeks due to it not being included on the list.

I really liked wycats proposal of moving this sort of thing to the controller - it's a much more logical place to look, and I do think there's a thing as a too-skinny controller - mapping inputs to model attributes is a perfectly sane thing for the controller to do IMO.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: