Method: IshManager::IroAlertsController#update

Defined in:
app/controllers/ish_manager/iro_alerts_controller.rb

#updateObject



36
37
38
39
40
41
42
43
44
45
46
# File 'app/controllers/ish_manager/iro_alerts_controller.rb', line 36

def update
  @alert = Iro::Alert.find params[:id]
  authorize! :update, @alert
  flag = @alert.update_attributes params[:iro_alert].permit!
  if flag
    flash[:notice] = 'Updated iro alert.'
  else
    flash[:alert] = "Cannot update iro alert: #{@alert.errors.full_messages.join(', ')}."
  end
  redirect_to action: 'index'
end