base_controller.rb 444 B

1234567891011121314151617181920212223
  1. # frozen_string_literal: true
  2. module Admin
  3. class BaseController < ApplicationController
  4. include Authorization
  5. include AccountableConcern
  6. layout 'admin'
  7. before_action :require_staff!
  8. before_action :set_body_classes
  9. private
  10. def set_body_classes
  11. @body_classes = 'admin'
  12. end
  13. def set_user
  14. @user = Account.find(params[:account_id]).user || raise(ActiveRecord::RecordNotFound)
  15. end
  16. end
  17. end