Sha256: 8afa13cec0e43ae2eb87fdf3dc21d04489afa8c4ffa5c9fab4e1bfaee6cf1481

Contents?: true

Size: 478 Bytes

Versions: 1

Compression:

Stored size: 478 Bytes

Contents

# frozen_string_literal: true

module ActionLink
  # An action link that indicates showing an existing record.
  class Show < Base
    ICON = 'chevron-circle-right'

    erb_template <<~ERB.gsub("\n", '')
      <% if permission? %>
      <%= link_to(url, **options) do %>
      <%= content %>
      <% if icon? %><%= ' ' %><%= icon_tag ::ActionLink::Show::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/show.rb