mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-11-15 17:31:27 +00:00
16 lines
399 B
Ruby
16 lines
399 B
Ruby
|
class PredictionsController < ApplicationController
|
||
|
def create
|
||
|
@prediction = Prediction.new params[:prediction]
|
||
|
@prediction.user = cuser
|
||
|
raise AccessError unless @prediction.can_create? cuser
|
||
|
|
||
|
if @prediction.save
|
||
|
flash[:notice] = t(:predictions_create)
|
||
|
else
|
||
|
flash[:error] = @prediction.errors.full_messages.to_s
|
||
|
end
|
||
|
|
||
|
redirect_to @prediction.match
|
||
|
end
|
||
|
end
|