0

I am trying to use both the acts_as_commentable_with_threading and acts_as_votable gems in my rails app.

I am not sure how I can perform the steps needed to turn on "acts_as_votable" on the acts_as_commentable_with_threading gem file that my app is using.

The readme for the gem says the following: "If you plan to use the acts_as_votable plugin with your comment system be sure to uncomment the line acts_as_votable in lib/comment.rb."

I tried doing the following and I still get an error.

First unpack the gem:

gem unpack acts_as_commentable_with_threading

Second edit the comment.rb file as indicate to uncomment the "acts_as_votable" line.

Third try to have the bundler use the local copy of the gem which saved above my /app folder:

gem "acts_as_commentable_with_threading", path: "acts_as_commentable_with_threading-2.0.1"

Then run bundle install. When using the get_upvotes method provided by the votable gem i get the following error:

undefined method `get_upvotes' for #<Comment:0x00007fa37dbf13f0>
Naresh
  • 16,698
  • 6
  • 112
  • 113
  • You don't need a local version of gem, I think. In one of your previous questions you've generated `models/comment.rb` file. You need to uncomment `acts_as_votable` line in this file, not inside the gem – Vasilisa Feb 28 '19 at 05:42
  • Thanks again! the readme on the gem is a bit confusing. – eddie paulino Feb 28 '19 at 13:20

0 Answers0