ensl.org/app/controllers/votes_controller.rb
2014-03-31 22:37:38 +01:00

13 lines
271 B
Ruby

class VotesController < ApplicationController
def create
@vote = Vote.new(params[:vote])
@vote.user = cuser
raise AccessError unless @vote.can_create? cuser
if @vote.save
flash[:notice] = t(:votes_success)
end
redirect_to_back
end
end