Module: DmCore::Admin::ApplicationHelper

Included in:
AdminController
Defined in:
app/helpers/dm_core/admin/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#admin_path_active_class?(*paths) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
19
20
21
# File 'app/helpers/dm_core/admin/application_helper.rb', line 16

def admin_path_active_class?(*paths)
  active = false
  # paths.each { |path| active ||= current_page?(path) }
  paths.each { |path| active ||= request.url.include?(path) }
  active ? 'active' : nil
end

#is_current_controller(controller_name) ⇒ Object




10
11
12
# File 'app/helpers/dm_core/admin/application_helper.rb', line 10

def is_current_controller(controller_name)
  controller.controller_name == controller_name
end

#switch_user(user) ⇒ Object

Switch to the different user




5
6
7
# File 'app/helpers/dm_core/admin/application_helper.rb', line 5

def switch_user(user)
  (:user, user)
end