I have a Rails application, which is a blogging platform that allows multiple authors to use it. My User Model has an attribute : writer for defining write permissions. However : writer is NOT specified in attr_accessible for the User model.
I wanted to edit this attribute over the Internet, without having to run
User.find_by_id(user_id).update_attribute(:writer, true/false)
through the console, but I wonder if this is impossible without listing : writer in attr_accessible for the User model. I have several pages available only to admin users, and I would like to be able to switch the : writer attribute into these views.
If this is really possible, how can this be done? Thanks in advance for your help!
Edit: Based on the two answers I received, I believe that should have been more specific in my question. I apologize. I understand that I could individually update the : writer attribute, as Beerlington and Hitesh pointed out. I wanted to know how to implement such a function through a view. Can I make an interactive link to switch state: writer? Is it possible for the link to call the controller function and pass the corresponding user_id to switch : writer ?
source share