Hi, I'm having difficulty setting up Devise. I'm following Ryan Bates tutorial for Devise with Twitter authentication but in Rails 4. . I can login with Twitter but I can't register with Devise alone (i.e. without using Twitter). I'm getting an unpermitted parameters error with the name field, even though I have the following code in my application controller
def configure_permitted_parameters
devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:name, :email, :provider, :image, :password, :password_confirmation) }
devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:name, :email, :provider, :image, :password, :password_confirmation) }
end
And even if I remove the name field from the sign up form (i.e. just sign up with email and password), it's rolling back the transaction.
Can anyone explain what I might be doing wrong?
Started POST "/users" for 127.0.0.1 at 2013-06-27 07:45:53 -0700
Processing by RegistrationsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"jlbhkdXuRjChKXJltoemYnuOGtyfAoEgGobdPf1LB7Q=", "user"=>{"email"=>"
skan...@gmail.com", "name"=>"skankyguy", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
Unpermitted parameters: name
(1.5ms) BEGIN
User Exists (0.4ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = '
skan...@gmail.com' LIMIT 1
User Exists (0.4ms) SELECT 1 AS one FROM "users" WHERE "users"."name" IS NULL LIMIT 1
User Exists (0.5ms) SELECT 1 AS one FROM "users" WHERE LOWER("users"."email") = LOWER('
skan...@gmail.com') LIMIT 1
(0.7ms) ROLLBACK
Rendered devise/registrations/_navigation.html.erb (0.6ms)
Rendered devise/shared/_links.erb (1.4ms)
Rendered devise/registrations/new.html.erb within layouts/application (21.9ms)
Completed 200 OK in 193ms (Views: 59.5ms | ActiveRecord: 3.5ms)