osem-fcy/app/controllers/admin/targets_controller.rb
2014-07-30 09:40:20 +03:00

22 lines
736 B
Ruby

module Admin
class TargetsController < ApplicationController
load_and_authorize_resource :conference, find_by: :short_title
authorize_resource :target, through: :conference
def index
end
def update
if @conference.update_attributes(params[:conference])
redirect_to(admin_conference_targets_path(
conference_id: @conference.short_title),
notice: 'Targets were successfully updated.')
else
redirect_to(admin_conference_targets_path(
conference_id: @conference.short_title),
alert: 'Targets update failed: ' \
"#{@conference.errors.full_messages.join('. ')}")
end
end
end
end