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.

初学者のプログラミング NoMethodErrorの解決について

0
Last updated at Posted at 2021-03-18

データをオブジェクトに追加する時に起きた

NoMethodError (undefined method `books' for #<Author:0x00007fecdeca2fd8>)

データを作成して、紐付けてあるオブジェクトに追加しようとして起きた。
調べてみるとエラー文の内容は「定義されていない」という意味だったため、コンソール上で確認してみたところ、データは確認できたため、定数を再度、定義しなおしたら解決した。

さいごに

プログラミングの初学者です。その日に学んだことを学習の一環としてアウトプットしています。より深く学習していきたいと考えておりますので、ご指摘等いただけますと幸いです。

参考図書:パーフェクト Ruby on Rails【増補改訂版】すがわらまさのり/前島真一/橋立友宏/後藤優一/五十嵐邦明

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?