Sha256: 6d9e1857dbfd38a8be4bbef328ebe7f5d45672a9788051ee9f509559b1705147

Contents?: true

Size: 471 Bytes

Versions: 1

Compression:

Stored size: 471 Bytes

Contents

# frozen_string_literal: true

module ActionLink
  # An action link that indicates editing an existing record.
  class Edit < Base
    ICON = 'pencil-circle'

    erb_template <<~ERB.gsub("\n", '')
      <% if permission? %>
      <%= link_to(url, **options) do %>
      <%= content %>
      <% if icon? %><%= ' ' %><%= icon_tag ::ActionLink::Edit::ICON %><% end %>
      <% end %>
      <% else %>
      <%= content %>
      <% end %>
    ERB

    option :url
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
action_link-0.1.1 app/components/action_link/edit.rb