ensl.org/app/controllers/predictions_controller.rb
Ari Timonen e59e8ac8e7 Lots of rails 4 updates
- Add .params to models and update controllers
- Add afk time to gather
- Reannotate models
- Fix rspec problem by using latest rspec plugins from github
2020-03-18 05:38:17 +02:00

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