Questions tagged [acts-as-votable]

Acts As Votable is a Ruby on Rails gem that provides voting for models.

Acts As Votable is a Ruby Gem specifically written for Rails/ActiveRecord models. The main goals of this gem are:

  • Allow any model to be voted on, like/dislike, upvote/downvote, etc.
  • Allow any model to be voted under arbitrary scopes.
  • Allow any model to vote. In other words, votes do not have to come from a user, they can come from any model (such as a Group or Team).
  • Provide an easy to write/read syntax.

Link To Gem

80 questions
1
vote
2 answers

Rails upvote/downvote using Ajax and acts_as_votable

Still fairly new to Rails. I used the acts_as_votable gem to create upvote and upvote buttons to allow users to upvote/downvote jokes, but I can't make them change from upvote / downvote (and vice versa) and update the counter each time they click…
1
vote
0 answers

acts_as_votable upvote method generating 'get' request

I have acts_as_votable configured like so to generate upvoting and downvoting of content in my app: partial:
<%= link_to like_link_path(link), method: :put, class: "btn btn-success btn-sm" do %>
Jbur43
  • 1,284
  • 17
  • 38
0
votes
0 answers

acts_as_votable is not working in Rails 7

I made a partial render "_likes.html.erb" as follow <%= pluralize(post.get_likes.size, 'Like')%> <% if current_user %> <% vote_text = current_user&.voted_for?(post) ? "unlike" : "Like" %> <%= button_to vote_text, like_post_path(post), method:…
0
votes
0 answers

Can not find post ID with acts_as_votable gem Rails

error message: undefined method `id' for nil:NilClass In the postscontroller: def like if current_user.voted_for? @post @post.unliked_by current_user else @post.liked_by current_user end end In the _like_link.html.erb: <%…
0
votes
1 answer

Missing template events/favorite.js.erb

I'm trying to get the gem acts as votable to work without having to page refresh. I do have the acts as votable gem working with the page refresh without AJAX. I'm following the steps on this blog by Superails. I feel the main difference between his…
Ogarocious
  • 119
  • 6
0
votes
1 answer

Rails acts_as_votable contest

i'm working on a contest rails 7 app and i'm using act_as_votable to vote on user projects, but i'm stuck in the fact that user have to vote in every contest phases and vote have to be reinitialized for every phases but i'm my app it's the same vote…
0
votes
1 answer

how to get all the posts upvoted be current user using acts_as_votable gem

i want to show all the posts users have upvoted on, how can I do this.
0
votes
1 answer

Http request work differently from the parameter I gave in Ruby on Rails

I have article model and i want to give it votable ability with acts_as_votable gem.I have like_article route for like article and its PUT method and i have that route in my file <%= link_to like_article_path(article), method: :put do %> Like …
0
votes
1 answer

Check if voted for Scope with a specific vote weight with Acts As Voteable

I’m using the acts as votable gem in my rails app, to give users the option to leave a 1-5 rating on a Resource under different scopes. 
For example, Users can rate Location 1-5, Price 1-5 etc.. I currently have this code to check if a user has…
tommers
  • 51
  • 7
0
votes
0 answers

Using Act as Votable with Paginate, Undefined method

I am trying to use paginate with act as votable but I'm getting a few errors. My favorites method is to display a page that shows only items that the user upvoted. def favorites @title = "Favorites" @user = User.find(params[:id]) …
SJK
  • 135
  • 1
  • 10
0
votes
0 answers

NameError: uninitialized constant ActsAsVotableMigration

I just cloned a github repo (of mine) that I had previously deleted from my computer because I messed up the local repo beyond repair. When I tried to run rake db:migrate, I got: rake aborted! NameError: uninitialized constant…
0
votes
1 answer

RoutingError (No route matches [GET]) on heroku

In my app i am using act_as_votable to vote my products, it works fine on localhost but on heroku am getting: RoutingError (No route matches [GET] "/products/1/like"): My routes resources :products do member do put "like"…
peter
  • 45
  • 6
0
votes
1 answer

the default table name is "votes" for gem acts_as_votable, can I change to whatever name I want? and how?

The default table name is "voter" for gem acts_as_votable, how can I change the table name to whatever I want? It conflicts with another table name of mine.
Danli Denny Deng
  • 351
  • 3
  • 14
0
votes
0 answers

Using acts_as_commentable and acts_as_votable ROR

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…
0
votes
0 answers

Rails Ajax Issue

I am trying to add a liking functionality to a place object that I have created in rails -- I'm using Actsasvotable and have no issue adding/deleting likes from the database. However, I am now stuck and can't figure out how to add the like without a…
John
  • 9
  • 1