Class: Maquina::Navbar::MenuItemLink
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- Maquina::Navbar::MenuItemLink
- Includes:
- ApplicationView
- Defined in:
- app/views/maquina/navbar/menu_item_link.rb
Instance Method Summary collapse
-
#initialize(option, path, desktop: true, active: false) ⇒ MenuItemLink
constructor
A new instance of MenuItemLink.
- #view_template ⇒ Object
Methods included from ApplicationView
#attribute_human_name, #button_to, #image_tag, #link_to, #model_human_name, #svg_icon
Constructor Details
#initialize(option, path, desktop: true, active: false) ⇒ MenuItemLink
Returns a new instance of MenuItemLink.
9 10 11 12 13 14 |
# File 'app/views/maquina/navbar/menu_item_link.rb', line 9 def initialize(option, path, desktop: true, active: false) @option = option @path = path @active = active @desktop = desktop end |
Instance Method Details
#view_template ⇒ Object
16 17 18 |
# File 'app/views/maquina/navbar/menu_item_link.rb', line 16 def view_template a(href: @path, **classes("#{link_type}-menu-item", active?: "#{link_type}-menu-item__active")) { t("menu.main.#{@option}") } end |