I'm trying to create a follower function, but when I press the follow button, I get the following error.
In addition, I have not set to restrict the follow of my own posts.
I would appreciate it if you could point out something.

Class FollowsController
  • Answer # 1

    It was a method error caused by accessing a function that requires login while current_user is nil, that is, not logged in. I had to be redirected to the login screen when I pressed the follow button when I wasn't logged in.