Method: CoreDropdownHelper#dropdown_item

Defined in:
app/helpers/core_dropdown_helper.rb


20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'app/helpers/core_dropdown_helper.rb', line 20

def dropdown_item(path, icon_name, action_name, method: :get, confirm: nil, classes: [])
  data = { method: method, turbo_method: method }
  if confirm.present?
    data[:confirm] = confirm
    data[:turbo_confirm] = confirm
  end
  classes << 'dropdown-item'
  (:li) do
    concat((:a, class: classes.join(' '), href: path, data: data) do
      concat(svg_icon(icon_name))
      concat(action_name)
    end)
  end
end