13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'app/helpers/view_component/menu_component.rb', line 13
def (menu_items:, position: 'right', html_options: {})
position_key = position.to_s.downcase.to_sym
position_class = MENU_POSITIONS[position_key] || MENU_POSITIONS[:right]
= .map do |item|
item.options ||= {}
item.url = item.url.presence || 'javascript:void(0)'
item
end
render(
'view_components/menu_component/menu_component',
menu_items: ,
position_class: position_class,
html_options:
)
end
|