I’ve got a RPG website and I want users to be able to set their name on registering but not when they’re editing their profile. But I want as an admin to be able to edit it.
Since I use update_attributes in the update action, I think they’re able to update their first_name not using the classic form I provide.
Is there a way to do this with ActiveRecord validations or simply in the controller ?
Thanks in advance !
Add
attr_accessible :name, :as => :adminto yourUsermodel, and in the sign-up controller use@user.update_attributes(params[:user], :as => :admin). Theupdateaction should instead use@user.update_attributes(params[:user])without the:as => :adminoption.More on this topic: Rails 3.1 Overview