Home>
Cannot save user_id

I thought I wanted to implement a nice feature, but before that I thought I didn't associate a post with a user_id
https://qiita.com/nojinoji/items/2c66499848d882c31ffa
An error occurs when trying to link user_id to a post referring to.

Error message
NameError in CommentsController # create
uninitialized constant Comment :: Like
Sample code
class CommentsController  []})
    end
end
class UserController
class User
class Comment

If i search with an error message, you cannot read the defined class.
https://qiita.com/imotan/items/c73fab5ee230114a08b6
Confirmed models/user as follows.

  • Answer # 1

    Isn't model like being made?

Related articles