1

I'm developing a Rails app where users can follow a tag. I'm using acts_as_taggable and acts_as_follower, but I don't know how to proceed.

User model:

class User < ApplicationRecord

 acts_as_follower

end

Posts model

class Post < ApplicationRecord
 belongs_to :user
 acts_as_taggable_on :tags
end

But where should I put acts_as_followable?

jmattheis
  • 10,494
  • 11
  • 46
  • 58

1 Answers1

0

You should put acts_as_followable on anything you want users to be able to follow. In this case, I'm assuming you want users to be able to follow posts, so:

class Post < ApplicationRecord
 belongs_to :user
 acts_as_taggable_on :tags
 acts_as_followable
end

Keep in mind that this gem is completely unrelated to the acts_as_taggable_on gem. They do different things and do not interact by default.

eiko
  • 5,110
  • 6
  • 17
  • 35