working on image feature
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<%= turbo_frame_tag dom_id(entry, :images) do %>
|
||||
<% if entry.images.attached? %>
|
||||
<div class="entry-images">
|
||||
<% entry.images.each do |image| %>
|
||||
<figure class="entry-image">
|
||||
<%= link_to rails_blob_path(image, disposition: "inline"), target: "_blank", rel: "noopener" do %>
|
||||
<%= image_tag rails_blob_path(image, disposition: "inline"), alt: image.filename.to_s, class: "entry-image__thumbnail" %>
|
||||
<% end %>
|
||||
|
||||
<figcaption><%= image.filename %></figcaption>
|
||||
|
||||
<%= button_to "Delete", delete_path_for.call(image), method: :delete, class: "button button--danger button--small" %>
|
||||
</figure>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<span>No images attached.</span>
|
||||
<% end %>
|
||||
|
||||
<p class="entry-images__actions">
|
||||
<%= link_to "Add images", add_path, class: "button button--secondary button--small" %>
|
||||
</p>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user