Home>

As the title says, I'm trying to link models using belongs_to and has_one, but it doesn't work.

・ What i am trying to do
rails g devise Account
I want to be able to call the contents of the Post model from the Account model by associating the Account model created in step 1 with the Post model that saved the contents of the micropost.

account.rb

class Account


post.rb

class Post

Even if I enter Account.find (1) .Post as above, I get a No method error and I am told that Post cannot be found.
I would appreciate it if you could tell me why it didn't work or another way.

20201109075604_create_posts.rb

class CreatePosts