Module: Admin::BaseHelper
- Defined in:
- app/helpers/admin/base_helper.rb
Instance Method Summary collapse
- #admin_header ⇒ Object
- #admin_sign_out_path ⇒ Object
- #admin_title ⇒ Object
- #apps ⇒ Object
- #display_flash_message(message = flash) ⇒ Object
- #has_root_path? ⇒ Boolean
- #login_info ⇒ Object
- #title(page_title) ⇒ Object
Instance Method Details
#admin_header ⇒ Object
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_path ⇒ Object
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_title ⇒ Object
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 |
#apps ⇒ Object
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 ( = flash) if .keys.any? locals = { :flash_type => .keys.first, :message => } render "helpers/admin/base/flash_message", locals end end |
#has_root_path? ⇒ 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_info ⇒ Object
25 26 27 |
# File 'app/helpers/admin/base_helper.rb', line 25 def login_info 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 |