0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

unknown attribute 'email' for Staff::LoginForm.

Posted at

Staff::LoginForm classに emailがないよと仰っておられます。最初はカラム名違いを疑いましたが、マイグレーションファイルは問題ないようです。スクリーンショット 2021-06-18 18.37.38.png

rails cでコンソールに入り、Staff::LoginForm.newを入力。

NoMethodError (undefined method `attr_acceser' for Staff::LoginForm:Class)
Did you mean?  attr_accessor
               mattr_accessor

attr_accessorじゃないの?と仰られてます。attr_acceserをvscodeの検索窓で検索。

<変更前>

login_form.rb
class Staff::LoginForm
  include ActiveModel::Model
  attr_acceser :email, :password
end

<変更後>

login_form.rb
class Staff::LoginForm
  include ActiveModel::Model
  attr_accessor :email, :password
end

無事に解消しました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?