Module: Admin::BaseHelper

Defined in:
app/helpers/admin/base_helper.rb

Instance Method Summary collapse

Instance Method Details

#admin_headerObject



7
8
9
10
# File 'app/helpers/admin/base_helper.rb', line 7

def admin_header
  locals = { :admin_title => admin_title }
  render "helpers/admin/base/header", locals
end

#admin_sign_out_pathObject



29
30
31
32
33
34
35
36
# File 'app/helpers/admin/base_helper.rb', line 29

def admin_sign_out_path
  case Typus.authentication
  when :devise
    send("destroy_#{Typus.user_class_name.underscore}_session_path")
  else
    destroy_admin_session_path
  end
end

#admin_titleObject



12
13
14
15
# File 'app/helpers/admin/base_helper.rb', line 12

def admin_title
  setting = defined?(Admin::Setting) && Admin::Setting.admin_title
  setting || Typus.admin_title
end

#appsObject



21
22
23
# File 'app/helpers/admin/base_helper.rb', line 21

def apps
  render "helpers/admin/base/apps"
end

#display_flash_message(message = flash) ⇒ Object



38
39
40
41
42
43
# File 'app/helpers/admin/base_helper.rb', line 38

def display_flash_message(message = flash)
  if message.keys.any?
    locals = { :flash_type => message.keys.first, :message => message }
    render "helpers/admin/base/flash_message", locals
  end
end

#has_root_path?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'app/helpers/admin/base_helper.rb', line 17

def has_root_path?
  Rails.application.routes.routes.map(&:name).include?("root")
end

#login_infoObject



25
26
27
# File 'app/helpers/admin/base_helper.rb', line 25

def 
  render "helpers/admin/base/login_info" unless admin_user.is_a?(FakeUser)
end

#title(page_title) ⇒ Object



3
4
5
# File 'app/helpers/admin/base_helper.rb', line 3

def title(page_title)
  content_for(:title) { page_title }
end