このエラーが発生しています:
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.[]
この行から:
user = User.any_of({:user_name => login},{:email => login}).first #.and(:encrypted_password => nil).first
私はRubyが初めてなので、まだ構文のコツをつかもうとしています。オブジェクト nil[] エラーが発生する原因となる、特に間違っている、またはエラーが発生しやすいものはありますか?
また、次の行は、.downcase なしで試しても同じエラーを作成しています
login = (params[:user][:login]).downcase
ありがとう!!