Created
September 17, 2012 22:43
-
-
Save samuelkobe/3740239 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HairstylesController < ApplicationController | |
before_filter :ip_check, :only => [:vote] | |
def vote | |
if @hairstyle = Hairstyle.find(params[:id]) | |
@hairstyle.increment('count') | |
@hairstyle.save | |
redirect_to root_url, notice: 'Thanks for Voting' | |
end | |
end | |
private | |
def ip_check | |
redirect_to :action => 'vote', :id => params[:id] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment