2014-08-06 21:14:00 +03:00
|
|
|
module Admin
|
2014-08-13 14:37:05 +03:00
|
|
|
class SupporterLevelsController < Admin::BaseController
|
2014-08-12 11:51:59 +03:00
|
|
|
load_and_authorize_resource :conference, find_by: :short_title
|
|
|
|
|
authorize_resource through: :conference
|
|
|
|
|
|
|
|
|
|
def index
|
|
|
|
|
authorize! :update, SupporterLevel.new(conference_id: @conference.id)
|
|
|
|
|
end
|
2013-02-02 16:43:47 +01:00
|
|
|
|
2014-08-06 21:14:00 +03:00
|
|
|
def show
|
|
|
|
|
render :supporter_levels
|
|
|
|
|
end
|
2013-02-02 16:43:47 +01:00
|
|
|
|
2014-08-06 21:14:00 +03:00
|
|
|
def update
|
|
|
|
|
begin
|
|
|
|
|
@conference.update_attributes!(params[:conference])
|
|
|
|
|
redirect_to(admin_conference_supporter_levels_path(conference_id: @conference.short_title), notice: 'Supporter levels were successfully updated.')
|
|
|
|
|
rescue => e
|
|
|
|
|
redirect_to(admin_conference_supporter_levels_path(conference_id: @conference.short_title), alert: "Supporter levels update failed: #{e.message}")
|
|
|
|
|
end
|
2013-02-02 16:43:47 +01:00
|
|
|
end
|
|
|
|
|
end
|
2014-06-30 17:07:53 +02:00
|
|
|
end
|