Class: Admin::ApplicationController

Inherits:
Administrate::ApplicationController
  • Object
show all
Includes:
Administrate::Punditize, ErrorHandlers, Pundit
Defined in:
lib/kowl/templates/app/controllers/admin/application_controller.rb

Direct Known Subclasses

LoginActivitiesController, UsersController

Instance Method Summary collapse

Instance Method Details

#ensure_admin!Object

Override this value to specify the number of elements to display at a time on index pages. Defaults to 20. def records_per_page

params[:per_page] || 20

end Used to ensure only superusers and staff members can access the admin dashboards



25
26
27
# File 'lib/kowl/templates/app/controllers/admin/application_controller.rb', line 25

def ensure_admin!
  redirect_to root_path, notice: 'Not authorized!' unless current_user.present? && current_user.staff_member?
end