demarches-normaliennes/app/controllers/manager/application_controller.rb
2018-11-06 19:22:01 +01:00

23 lines
476 B
Ruby

module Manager
class ApplicationController < Administrate::ApplicationController
before_action :authenticate_administration!
before_action :default_params
def default_params
params[resource_name] ||= {
order: "created_at",
direction: "desc"
}
end
protected
def authenticate_administration!
if administration_signed_in?
super
else
redirect_to manager_sign_in_path
end
end
end
end