The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

yeehaa123 (4) [Avatar] Offline

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])
if && @user.update_attribute("admin", admin == "1")
redirect_to admin_users_path, notice: "User has been created."
flash[:alert] = "User has not been created."
render action: "new"

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.