attr_accessibleunavailable for Rails version 4+. You will have to go with strong parameters.
With strong parameters, the attribute attribute attribute has moved to the controller level. Remove the call attr_accessiblefrom your model.
Here is an example in the Rails Guide on how to use Strong Parameters
In your case, you can do something like this:
class UsersController < ApplicationController
def create
@user = User.new(user_params)
if @user.save
redirect_to @user, notice: 'User was successfully created.'
else
render action: 'new'
end
end
private
def user_params
params.require(:user).permit(:name, :password_digest, :password, :password_confirmation)
end
end
You can take note of @Frederick's comment below my answer,
attr_accessible, protected_attributes ( )