mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-28 13:31:06 +00:00
14 lines
270 B
Ruby
14 lines
270 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
|