After reading about attr_accessible in the Rails 3.1 API, I see that there is an as :admin
option in there. I would like to know two things.
If the user has an admin flag, how do does my controller tell my model that the user is an admin.
If the user is an owner, can i specify
:as => owner
in my model, and once again how does my controller inform my model they are the owner of an item.
@project.update_attributes(params[:project], :as => current_user.role.to_sym)
but but i get an error that saysupdate_attributes
accepts only one argument. What happened to theas: :admin
part of this code? is it safe to remove it completely? – Menendez