ActionController::UnfilteredParameters (unable to convert unpermitted parameters to hash) - Rails 5

Viewed 8294

i have this error but not quite sure how to solve it. I have an API version module VI and my usercontroller module is like this

class Api::V1::UsersController < ApplicationController
  def register
    ap params
  end

  def user_params
    params.require(:user).permit(
      :email, :password,:password_confirmation, :username, :name, :fb_id, :picture, :access_token, :reset_password_token,
      :sign_in_count, :authenticatable_salt, :current_sign_in_at, :last_sign_in_at, :current_sign_in_ip, :last_sign_in_ip
    )
  end
end

I have a register function and each time i want to log the params, i get an error

ActionController::UnfilteredParameters (unable to convert unpermitted parameters to hash)

Not sure how to solve this given that i have already permitted the attributes for my user model already.

I didnt include the gem strong_parameters but not sure if i have to because i dont think i have to include it.

I know permitting the attributes would have worked for Rails 4 not sure why it is not working for Rails 5. Do i need to do anything on my model as well?

1 Answers
Related