anyone -- know how to limit the user to 1 vote.
I cannot believe this book did not include the code for this.
I'm assuming that the code belongs in the story controller...somewhere here:
def vote
@story = Story.find(params[:id])
@story.votes.create ( :user => @current_user)
I'm new...I googled everything, and have found nothing.
I'm assuming it would be an if /else statement...checking to see if the story has a user id that matches the current user id. If so, the vote should not be counted.
Any help would be great. It's a good book. But not including code like this makes this book incomplete.



use validations [1]:

Bookmarks