ホームページからモーダル ウィンドウ経由でサインアップ フォームを送信しようとすると、「param not found: user」というエラーが表示されます。
ActionController::ParameterMissing in UsersController#create
param not found: user
def user_params
params.require(:user).permit(:email, :password, :password_confirmation)
end
渡されたパラメータは次のとおりです。
Parameters:
{"utf8"=>"✓",
"authenticity_token"=>"eXXn7+Rsf4SLciRPn4RW8Lw+3u6/FJZi8IW2XxekYsU=",
"email"=>"asdf@asdf.com",
"password"=>"[FILTERED]",
"password_confirmation"=>"[FILTERED]",
"commit"=>"Sign up"}
ここに users_controller.rb があります
class UsersController < ApplicationController
def new
user = User.new
end
def create
user = User.new(user_params)
if user.save
auto_login(user)
redirect_to root_path
else
render :new
end
end
private
def user_params
params.require(:user).permit(:email, :password, :password_confirmation)
end
end
私にはすべて問題ないように見えますが、明らかに何かが間違っています。誰にもアイデアはありますか?ありがとう!