Class: ActiveAdmin::SidebarSection
- Inherits:
-
Object
- Object
- ActiveAdmin::SidebarSection
- Includes:
- OptionalDisplay
- Defined in:
- lib/active_admin/sidebar_section.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #custom_class ⇒ Object
-
#id ⇒ Object
The id gets used for the div in the view.
-
#initialize(name, options = {}, &block) ⇒ SidebarSection
constructor
A new instance of SidebarSection.
-
#partial_name ⇒ Object
If a block is not passed in, the name of the partial to render.
- #priority ⇒ Object
-
#title ⇒ Object
The title gets displayed within the section in the view.
Methods included from OptionalDisplay
Constructor Details
#initialize(name, options = {}, &block) ⇒ SidebarSection
Returns a new instance of SidebarSection.
8 9 10 11 |
# File 'lib/active_admin/sidebar_section.rb', line 8 def initialize(name, = {}, &block) @name, @options, @block = name.to_s, , block end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
6 7 8 |
# File 'lib/active_admin/sidebar_section.rb', line 6 def block @block end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/active_admin/sidebar_section.rb', line 6 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
6 7 8 |
# File 'lib/active_admin/sidebar_section.rb', line 6 def @options end |
Instance Method Details
#custom_class ⇒ Object
28 29 30 |
# File 'lib/active_admin/sidebar_section.rb', line 28 def custom_class [:class] end |
#id ⇒ Object
The id gets used for the div in the view
14 15 16 |
# File 'lib/active_admin/sidebar_section.rb', line 14 def id "#{name.downcase.underscore}_sidebar_section".parameterize end |
#partial_name ⇒ Object
If a block is not passed in, the name of the partial to render
24 25 26 |
# File 'lib/active_admin/sidebar_section.rb', line 24 def partial_name [:partial] || "#{name.downcase.tr(' ', '_')}_sidebar" end |
#priority ⇒ Object
32 33 34 |
# File 'lib/active_admin/sidebar_section.rb', line 32 def priority [:priority] || 10 end |
#title ⇒ Object
The title gets displayed within the section in the view
19 20 21 |
# File 'lib/active_admin/sidebar_section.rb', line 19 def title I18n.t("active_admin.sidebars.#{name}", default: name.titlecase) end |