二行目にエラーが出ます。
アドレスとパスワードを書いてログインボタンを押したところこのエラーがでます。
どこが間違っているのかわかる方お願いします
Mongoid::Errors::DocumentNotFound in SessionsController#create
message: Document(s) not found for class User with id(s) {:email=>"kanrthsrtrip@example.org"}. summary: When calling User.find with an id or array of ids, each parameter must match a document in the database or this error will be raised. The search was for the id(s): {:email=>"kanrthsrtrip@example.org"} ... (1 total) and the following ids were not found: {:email=>"kanrthsrtrip@example.org"}. resolution: Search for an id that is in the database or set the Mongoid.raise_not_found_error configuration option to false, which will cause a nil to be returned instead of raising this error when searching for a single id, or only the matched documents when searching for multiples.
Extracted source (around line #6):
RUBY
1 def create 2 user = User.find(email: params[:session][:email].downcase) 3 if user && user.authenticate(params[:session][:password]) 4 log_in user 5 redirect_to user 6 end 7end
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。