Sha256: e2562a91da9102cad0605f2b227f04f9e5bd77e74f5feadfdb1abedd097fe322

Contents?: true

Size: 745 Bytes

Versions: 13

Compression:

Stored size: 745 Bytes

Contents

<%=
  link_to(
    path.presence || '#',
    method: path.present? && method != :get ? method : nil,
    data: { confirm_action: confirm },
    class: "btn #{button_class} #{float_class} #{kwargs_class}",
    title: title,
    **kwargs
  ) do %>
  <% if block_given %>
    <%= raw content %>
  <% else %>
    <span class="text-nowrap">
      <% if icon.present? %>
        <i class="fa-solid fa-<%= icon %>"></i>
      <% elsif type == :show %>
        <i class="fa-solid fa-eye"></i>
      <% elsif type == :edit %>
        <i class="fa-solid fa-pen"></i>
      <% elsif type == :destroy %>
        <i class="fa-solid fa-square-xmark"></i>
      <% end %>
      <span class="button-title"><%= title %></span>
    </span>
  <% end %>
<% end %>

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
active_element-0.0.14 app/views/active_element/components/button.html.erb
active_element-0.0.13 app/views/active_element/components/button.html.erb
active_element-0.0.12 app/views/active_element/components/button.html.erb
active_element-0.0.11 app/views/active_element/components/button.html.erb
active_element-0.0.10 app/views/active_element/components/button.html.erb
active_element-0.0.9 app/views/active_element/components/button.html.erb
active_element-0.0.8 app/views/active_element/components/button.html.erb
active_element-0.0.7 app/views/active_element/components/button.html.erb
active_element-0.0.6 app/views/active_element/components/button.html.erb
active_element-0.0.5 app/views/active_element/components/button.html.erb
active_element-0.0.4 app/views/active_element/components/button.html.erb
active_element-0.0.3 app/views/active_element/components/button.html.erb
active_element-0.0.2 app/views/active_element/components/button.html.erb