houndci fixes
This commit is contained in:
parent
c67700e0ae
commit
a0aa523122
11 changed files with 39 additions and 36 deletions
|
|
@ -35,7 +35,7 @@ class Admin::ConferenceController < ApplicationController
|
|||
else
|
||||
redirect_to(edit_admin_conference_path(id: short_title),
|
||||
alert: 'Updating conference failed. ' \
|
||||
"#{@conference.errors.full_messages.join('. ')}.")
|
||||
"#{@conference.errors.full_messages.join('. ')}.")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ class Admin::OrganizationsController < ApplicationController
|
|||
def create
|
||||
@organization = Organization.new(params[:organization])
|
||||
flash[:notice] = 'Organization was successfully created.' if @organization.save
|
||||
respond_with @organization, :location => admin_organizations_path
|
||||
respond_with @organization, location: admin_organizations_path
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
@ -27,7 +27,7 @@ class Admin::OrganizationsController < ApplicationController
|
|||
def update
|
||||
@organization = Organization.find(params[:id])
|
||||
flash[:notice] = 'Organization was successfully updated' if @organization.update_attributes(params[:organization])
|
||||
respond_with @organization, :location => admin_organizations_path
|
||||
respond_with @organization, location: admin_organizations_path
|
||||
end
|
||||
|
||||
def delete
|
||||
|
|
@ -37,7 +37,7 @@ class Admin::OrganizationsController < ApplicationController
|
|||
def destroy
|
||||
@organization = Organization.find(params[:id])
|
||||
@organization.destroy
|
||||
redirect_to admin_organizations_path, :notice => "Organization got deleted"
|
||||
redirect_to admin_organizations_path, notice: 'Organization got deleted'
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -8,10 +8,12 @@ class Admin::SponsorshipsController < ApplicationController
|
|||
params[:sponsorship_registration][:conference_id] = @conference.id
|
||||
sponsorship = SponsorshipRegistration.new(params[:sponsorship_registration])
|
||||
if sponsorship.save
|
||||
redirect_to(admin_conference_sponsorships_path(:conference_id => @conference.short_title), :notice => "Sponsorship added")
|
||||
redirect_to(admin_conference_sponsorships_path(
|
||||
conference_id: @conference.short_title), notice: 'Sponsorship added')
|
||||
else
|
||||
redirect_to(admin_conference_sponsorships_path(:conference_id => @conference.short_title),
|
||||
:alert => "Sponsorship creation failed.#{sponsorship.errors.full_messages.join('. ')}")
|
||||
redirect_to(admin_conference_sponsorships_path(conference_id: @conference.short_title),
|
||||
alert: 'Sponsorship creation failed.' \
|
||||
"#{sponsorship.errors.full_messages.join('. ')}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue