Class: Decidim::MenuItemPresenter
- Inherits:
-
Object
- Object
- Decidim::MenuItemPresenter
- Defined in:
- app/presenters/decidim/menu_item_presenter.rb
Overview
A presenter to render menu items
Instance Method Summary collapse
-
#initialize(menu_item, view, options = {}) ⇒ MenuItemPresenter
constructor
Initializes a menu item for presentation.
- #render ⇒ Object
Constructor Details
#initialize(menu_item, view, options = {}) ⇒ MenuItemPresenter
Initializes a menu item for presentation
19 20 21 22 23 |
# File 'app/presenters/decidim/menu_item_presenter.rb', line 19 def initialize(, view, = {}) @menu_item = @view = view @options = OpenStruct.new() end |
Instance Method Details
#render ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'app/presenters/decidim/menu_item_presenter.rb', line 28 def render content_tag :li, class: link_wrapper_classes do output = [link_to(composed_label, url, )] output.push(@view.send(:simple_menu, **@menu_item.).render) if @menu_item. safe_join(output) end end |