houndci fixes

This commit is contained in:
Gopesh Tulsyan 2014-05-26 15:43:19 +05:30
parent c67700e0ae
commit a0aa523122
11 changed files with 39 additions and 36 deletions

View file

@ -6,11 +6,14 @@ class Admin::SponsorshipLevelsController < ApplicationController
end
def update
begin
@conference.update_attributes!(params[:conference])
redirect_to(admin_conference_sponsorship_levels_path(:conference_id => @conference.short_title), :notice => 'Sponsorship levels were successfully updated.')
rescue Exception => e
redirect_to(admin_conference_sponsorship_levels_path(:conference_id => @conference.short_title), :alert => "Sponsorship levels update failed: #{e.message}")
if @conference.update_attributes!(params[:conference])
redirect_to(admin_conference_sponsorship_levels_path(
conference_id: @conference.short_title),
notice: 'Sponsorship levels were successfully updated.')
else
redirect_to(admin_conference_sponsorship_levels_path(
conference_id: @conference.short_title),
alert: 'Sponsorship levels update failed')
end
end
end