Rails – ActiveModel::ForbiddenAttributesError

  • by

Part of ensure data passed from forms is secure, remember to be restarting the application during these changes if everything seems to be correct.


class UsersController < ApplicationController

  def create
    @user = User.new(user_params)
    # ...
  end

  private

  def user_params
    //this is required to have each of the parameters 
    params.require(:user).permit(:username, :email, :password, :salt, :encrypted_password)
  end
end

refs:
https://duckduckgo.com/?t=ffab&q=ActiveModel%3A%3AForbiddenAttributesError&ia=web

Leave a Reply

Your email address will not be published. Required fields are marked *