Module: Refinery::Admin::BaseController

Included in:
Refinery::AdminController, Pages::Admin::PreviewController
Defined in:
core/lib/refinery/admin/base_controller.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'core/lib/refinery/admin/base_controller.rb', line 9

def self.included(base)
  base.layout :layout?

  base.before_action :force_ssl!,
                     :authenticate_refinery_user!,
                     :restrict_controller

  base.after_action :store_location?, :only => [:index] # for redirect_back_or_default

  base.helper_method :searching?, :group_by_date, :refinery_admin_root_path
end

Instance Method Details

#admin?Boolean



21
22
23
# File 'core/lib/refinery/admin/base_controller.rb', line 21

def admin?
  true # we're in the admin base controller, so always true.
end

#refinery_admin_root_pathObject



29
30
31
# File 'core/lib/refinery/admin/base_controller.rb', line 29

def refinery_admin_root_path
  current_refinery_user.landing_url
end

#searching?Boolean



25
26
27
# File 'core/lib/refinery/admin/base_controller.rb', line 25

def searching?
  params[:search].present?
end