I almost always use attr_accessible in my Rails models.
Is there a generator flag or other terminal command to haveattr_accessible and the model fields automatically inserted into the model file when I run a relevant generator?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not sure about that. But you can annotate your models using this gem.
It will add schema info in the model files as comments at the top of the file. Maybe that could help you in some way to create
attr_accessiblefields.