I have a Rails app that uses activescaffold and I would like to hide some fields on the update for some of the records.
I have been trying to do it using helper methods, but I can not seem to get that to work.
What is the best way to do this?
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.
The best way to do this is by using one of the security method templates (depending on your need) provided by activescaffold plugin.
Pasted from activescaffold wiki:
For example if you have an activescaffold based controller called user:
And you only want to allow the user to be able to update the username if they are admin then you can do something like this:
User Model:
Active Scaffold wiki link: https://github.com/activescaffold/active_scaffold/wiki/Security