2014-05-26 13:51:03 +05:30
|
|
|
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')
|
2014-05-26 13:51:03 +05:30
|
|
|
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('. ')}")
|
2014-05-26 13:51:03 +05:30
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|