Prox
Prox

Reputation: 759

In Rails, I am getting an error with fresh install of Devise

In Ruby on Rails I did a fresh install of Devise and I am getting this error when I go to my www.website.com/users/sign_in

undefined method `for' for #<Devise::ParameterSanitizer:0x007fad0fcf7b28> Did you mean? fork

Here is my application_controller.rb:

  def configure_permitted_parameters
    devise_parameter_sanitizer.for(:sign_up) << :name
    devise_parameter_sanitizer.for(:account_update) << :name
  end

Any ideas? I checked an I am running Devise Version 4.2.0

Upvotes: 1

Views: 40

Answers (1)

PhilVarg
PhilVarg

Reputation: 4811

You're probably using a newer version of devise. they've updated their syntax since 3.x

devise_parameter_sanitizer.for(:signup) do |u|
  u.permit(:name)
end

becomes

devise_parameter_sanitizer.permit(:signup, keys: [:name])

Upvotes: 1

Related Questions