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

24 lines
778 B
Ruby
Raw Normal View History

2014-08-06 21:14:00 +03:00
module Admin
class SupporterLevelsController < ApplicationController
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
2014-08-06 21:14:00 +03:00
def show
render :supporter_levels
end
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
end
end
2014-06-30 17:07:53 +02:00
end