Module: Decidim::Admin::IconLinkHelper
- Defined in:
- app/helpers/decidim/admin/icon_link_helper.rb
Instance Method Summary collapse
-
#icon_link_to(icon_name, link, title, options = {}) ⇒ Object
This helper adds the necessary boilerplate for the admin icon links.
Instance Method Details
#icon_link_to(icon_name, link, title, options = {}) ⇒ Object
This helper adds the necessary boilerplate for the admin icon links.
icon_name - A String representing the icon name link - The path or url where the link should point to. title - A String that will be shown when hovering the icon. options - An optional Hash containing extra data for the link:
method - Symbol of HTTP verb. Supported verbs are :post, :get, :delete, :patch, and :put.
class - Any extra class that will be added to the link.
data - This option can be used to add custom data attributes.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'app/helpers/decidim/admin/icon_link_helper.rb', line 16 def icon_link_to(icon_name, link, title, = {}) with_tooltip(title, .merge(class: "top")) do link_to(link, method: [:method], class: "action-icon #{[:class]}", data: [:data] || {}, title:, target: [:target]) do content_tag(:span, data: { tooltip: true, disable_hover: false, click_open: false }, title:) do icon(icon_name, aria_label: title, role: "img") end end end end |