Sha256: bcc26d3941f306f86642ab77043eeca68cd99fda456e86760cb465b7ae58f126
Contents?: true
Size: 495 Bytes
Versions: 9
Compression:
Stored size: 495 Bytes
Contents
class VotesController < BaseController before_filter :find_choice, :only => [:create] before_filter :login_required def new @post = Post.find(params[:post_id]) redirect_to user_post_path(@post.user, @post) end def create @vote = @choice.votes.new(:user => current_user, :poll => @choice.poll ) @vote.save respond_to do |format| format.js end end protected def find_choice @choice = Choice.find(params[:choice_id]) end end
Version data entries
9 entries across 9 versions & 1 rubygems