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
Methods included from OptionalDisplay
Constructor Details
#initialize(name, options = {}, &block) ⇒ SidebarSection
Returns a new instance of SidebarSection.
9 10 11 12 13 14 |
# File 'lib/active_admin/sidebar_section.rb', line 9 def initialize(name, = {}, &block) @name = name.to_s @options = @block = block end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
7 8 9 |
# File 'lib/active_admin/sidebar_section.rb', line 7 def block @block end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/active_admin/sidebar_section.rb', line 7 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'lib/active_admin/sidebar_section.rb', line 7 def @options end |
Instance Method Details
#custom_class ⇒ Object
26 27 28 |
# File 'lib/active_admin/sidebar_section.rb', line 26 def custom_class [:class] end |
#id ⇒ Object
The id gets used for the div in the view
17 18 19 |
# File 'lib/active_admin/sidebar_section.rb', line 17 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
22 23 24 |
# File 'lib/active_admin/sidebar_section.rb', line 22 def partial_name [:partial] || "#{name.downcase.tr(' ', '_')}_sidebar" end |
#priority ⇒ Object
30 31 32 |
# File 'lib/active_admin/sidebar_section.rb', line 30 def priority [:priority] || 10 end |