Class: FoxTail::Sidebar::MenuItemComponent
- Inherits:
-
ClickableComponent
- Object
- ClickableComponent
- FoxTail::Sidebar::MenuItemComponent
- Defined in:
- app/components/fox_tail/sidebar/menu_item_component.rb
Instance Method Summary collapse
- #before_render ⇒ Object
- #call ⇒ Object
-
#initialize(html_attributes = {}) ⇒ MenuItemComponent
constructor
A new instance of MenuItemComponent.
- #link? ⇒ Boolean
Constructor Details
#initialize(html_attributes = {}) ⇒ MenuItemComponent
Returns a new instance of MenuItemComponent.
82 83 84 85 86 87 |
# File 'app/components/fox_tail/sidebar/menu_item_component.rb', line 82 def initialize(html_attributes = {}) super [:id] ||= "menu_item_#{SecureRandom.alphanumeric 16}" [:menu_id] ||= "#{[:id]}_menu" end |
Instance Method Details
#before_render ⇒ Object
93 94 95 96 97 98 99 |
# File 'app/components/fox_tail/sidebar/menu_item_component.rb', line 93 def before_render super if with_right_icon "chevron-down" unless right_visual end end |
#call ⇒ Object
101 102 103 104 105 106 107 108 109 110 |
# File 'app/components/fox_tail/sidebar/menu_item_component.rb', line 101 def call content_tag :li do if concat render_collapsible_trigger concat else render_item end end end |
#link? ⇒ Boolean
89 90 91 |
# File 'app/components/fox_tail/sidebar/menu_item_component.rb', line 89 def link? ? false : super end |