osem-fcy/app/controllers/admin/sponsorships_controller.rb

20 lines
700 B
Ruby
Raw Normal View History

class Admin::SponsorshipsController < ApplicationController
before_filter :verify_organizer
def index
end
def create
params[:sponsorship_registration][:conference_id] = @conference.id
sponsorship = SponsorshipRegistration.new(params[:sponsorship_registration])
if sponsorship.save
2014-05-26 15:43:19 +05:30
redirect_to(admin_conference_sponsorships_path(
conference_id: @conference.short_title), notice: 'Sponsorship added')
else
2014-05-26 15:43:19 +05:30
redirect_to(admin_conference_sponsorships_path(conference_id: @conference.short_title),
alert: 'Sponsorship creation failed.' \
"#{sponsorship.errors.full_messages.join('. ')}")
end
end
end