Topic: 7.25 mass assing admin

Hi,

I am using a newer version of rails and ran into mass assign attributes problem. I've solved this in the controller as follows:

def create
admin = params[:user].delete(:admin)
@user = User.new(params[:user])
if @user.save && @user.update_attribute("admin", admin == "1")
redirect_to admin_users_path, notice: "User has been created."
else
flash[:alert] = "User has not been created."
render action: "new"
end
end

All my tests pass now, but (as a newbe) I am still a bit insecure about it. Can anyone tell me if this solution works, or did I miss something.

Thanks!

________________
Wholesale Jewelry