clarion/app/controllers/management/management_controller.rb
Andrew Radev c6750d3a1a Nest everything under /conferences/:id/ again
Would be more straightforward to work with, even if it's a bit more
verbose sometimes.
2015-07-19 11:46:47 +03:00

28 lines
619 B
Ruby

module Management
class ManagementController < ::ApplicationController
before_action :authenticate_user!, :authorize_user!
layout 'management'
private
def current_conference?
current_conference.present?
end
helper_method :current_conference?
def current_conference
if not @current_conference and params[:conference_id].present?
@current_conference = Conference.find(params[:conference_id])
end
@current_conference
end
helper_method :current_conference
def authorize_user!
head :forbidden unless current_user.admin?
end
end
end