Questions tagged [voting]

329 questions
0
votes
1 answer

Ruby on Rails Thumbs_up Redirect to User Sign In

I'm getting this error when a user tries to vote without first being signed-in: undefined method `vote_for' for nil:NilClass I have a regular "Post" scaffold and the users are voting on posts. How do I insert a command that redirects them to the…
mystic cola
  • 1,465
  • 1
  • 21
  • 39
0
votes
2 answers

Rails: Best way to implement a thumbs up/down for user/object interactions?

I'm trying to find a good method to implement a thumbs up/down feature for my Rails 4 app. The User can see multiple items on a page, and they can either thumbs up or down each item. I want them to be able to select the thumb up or down without the…
justindao
  • 2,273
  • 4
  • 18
  • 34
0
votes
1 answer

Ruby On Rails: Thumbs Up Voting Display Tally Results

I have the Thumbs_Up gem loaded and the voting is working fine. I added this code to the posts controller: def poll_winners @posts = Post.tally( { :at_least => 1, :limit => 20, :order => 'vote_count desc' }) I just can't figure out what…
0
votes
2 answers

MongoDB - Embeded Version for "Voting with Atomic Operators"

I read the Voting with Atomic Operators article. In this article, the voters field is an array of ObjectIds. But I would like to store the voters as an array of embedded documents with the following format: { user: ObjectId, date: Date, …
Trantor Liu
  • 8,770
  • 8
  • 44
  • 64
0
votes
3 answers

How to implement voting in Rails?

I am on RailsTutorial by Michael Hartl on chapter 10 and did some extra stuff to add a paperclip image to every micropost. As I added a photo to the Micropost, I call it a Microphoto. As now I did the following: Migrating the database correctly …
Peyman Mohamadpour
  • 17,954
  • 24
  • 89
  • 100
0
votes
1 answer

jquery and json response data

i try to get the json output after voting but i couldn't get the success message after voting. what kind of a json output i need to write in the voting page. pls help me. i don't know jquery even json but i adapted this to my site everything is ok.…
0
votes
1 answer

Runoff-style voting using Rails/ActiveRecord

I'm working on a website for a "runoff election"-style contest, i.e. voters can vote for multiple candidates, but voters can only vote once for any individual candidate. My models are: candidate voter vote Currently, I'm using the Cantor pairing…
alipman88
  • 33
  • 4
0
votes
1 answer

Allow users to vote once in PHP

I'm working on a school project where I need to allow users to vote on pictures. Users can a picture up or down. It's the idea that they can change their vote anytime, but they can't undo their vote, so once they voted it's either up or down. I've…
Jef
  • 791
  • 1
  • 18
  • 36
0
votes
2 answers

How do I make this code (or its concept) work. it includes html, javascript, and php

so i'm not very familiar with either javascript or php but what i want to do is create an automated voter for a certain site. its very simple. I have a url which increases the vote count by one. I have verified that entering this url counts as a…
0
votes
1 answer

how to make a bar rating system using logarithm

I want to make a bar rating system for my website and this is what i have actually: Which doesn't look nice at all :p. I want the height to increase like a Exponential curve gradually. Not too steep at the beginning, which gradually increase…
Alan Tyloo
  • 110
  • 1
  • 3
  • 10
0
votes
3 answers

Updating a partial via Ajax with Rails

I am trying to update a rails partial while using Ajax and having some trouble. Basically I have a Post with a Karma attribute. Users can vote up and vote down to take and remove Karma from the post. I would like to allow the user to…
Salman
  • 494
  • 4
  • 18
0
votes
2 answers

thumbs_up one highest liked picture (rails)

I'm having problems with the thumbs_up gem. Here is how my app works: Pictures act as voteable, users act as voters. They can like and dislike pictures (so the plusminus count can go negative, too). In the pictures database: user_id, :name, :image,…
figdig
  • 307
  • 2
  • 13
0
votes
1 answer

Multiple Author Voting System

Is it possible to implement a voting system in a collaborative multiple author blog in which when a post is created, but before it is published, the authors on the site could vote yes or no on whether or not the content was on topic or relevant to…
0
votes
1 answer

Rails simple voting gem without a voter model

I'm looking for a gem that will allow super simple voting. I'm going to let anyone vote on records, as there are no users at all. I found this and this but they seem to require a 'voter' model (a user model) to act as the 'votee'. Are there any gems…
Trevan Hetzel
  • 1,371
  • 7
  • 21
  • 42