mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-27 04:51:14 +00:00
e59e8ac8e7
- Add .params to models and update controllers - Add afk time to gather - Reannotate models - Fix rspec problem by using latest rspec plugins from github
15 lines
413 B
Ruby
15 lines
413 B
Ruby
class PredictionsController < ApplicationController
|
|
def create
|
|
@prediction = Prediction.new(Prediction.params(params, cuser))
|
|
@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
|