Class: ActiveAdmin::Views::HeaderRenderer
- Defined in:
- lib/active_admin/views/header_renderer.rb
Overview
Renderer for the header of the application. Includes the page title, global navigation and utility navigation.
Constant Summary
Constants included from Arbre::HTML
Arbre::HTML::AUTO_BUILD_ELEMENTS, Arbre::HTML::HTML5_ELEMENTS
Instance Attribute Summary
Attributes inherited from Renderer
Instance Method Summary collapse
-
#global_navigation ⇒ Object
protected
Renders the global navigation returned by ActiveAdmin::ResourceController#current_menu.
- #logout_method ⇒ Object protected
-
#logout_path ⇒ Object
protected
Returns the logout path from the application settings.
- #title ⇒ Object protected
- #to_html ⇒ Object
- #utility_navigation ⇒ Object protected
Methods inherited from Renderer
#call_method_or_proc_on, #haml, #initialize, #method_missing, #set_ivar_on_view, #to_s
Methods included from Arbre::HTML
#current_dom_context, #helpers, #method_missing
Methods included from ActiveAdmin::ViewHelpers::RendererHelper
Constructor Details
This class inherits a constructor from ActiveAdmin::Renderer
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ActiveAdmin::Renderer
Instance Method Details
#global_navigation ⇒ Object (protected)
Renders the global navigation returned by ActiveAdmin::ResourceController#current_menu
It uses the ActiveAdmin.tabs_renderer option
22 23 24 |
# File 'lib/active_admin/views/header_renderer.rb', line 22 def render view_factory., end |
#logout_method ⇒ Object (protected)
47 48 49 |
# File 'lib/active_admin/views/header_renderer.rb', line 47 def logout_method active_admin_application.logout_link_method || :get end |
#logout_path ⇒ Object (protected)
Returns the logout path from the application settings
39 40 41 42 43 44 45 |
# File 'lib/active_admin/views/header_renderer.rb', line 39 def logout_path if active_admin_application.logout_link_path.is_a?(Symbol) send(active_admin_application.logout_link_path) else active_admin_application.logout_link_path end end |
#title ⇒ Object (protected)
14 15 16 |
# File 'lib/active_admin/views/header_renderer.rb', line 14 def title content_tag 'h1', active_admin_application.site_title, :id => 'site_title' end |
#to_html ⇒ Object
8 9 10 |
# File 'lib/active_admin/views/header_renderer.rb', line 8 def to_html title + + end |
#utility_navigation ⇒ Object (protected)
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/active_admin/views/header_renderer.rb', line 26 def content_tag 'p', :id => "utility_nav" do if current_active_admin_user? html = content_tag(:span, display_name(current_active_admin_user), :class => "current_user") if active_admin_application.logout_link_path html << link_to(I18n.t('active_admin.logout'), logout_path, :method => logout_method) end end end end |