1
0
mirror of https://github.com/danbee/my-images synced 2025-03-04 08:49:05 +00:00
my-images/app/views/images/index.html.erb
Dan Barber 5b2d1d4d17
Migrate images to Active Storage
Also adds a rake task to do the migration.
2018-11-16 17:16:01 -05:00

23 lines
570 B
Plaintext

<% content_for :title do %>
<h1>My Images</h1>
<% end %>
<ul class="images">
<% @images.each do |image| %>
<li>
<%= link_to image_tag(image_thumb(image.image, 200)),
user_image_path(image), class: :image %><br>
<%= link_to 'Delete', user_image_path(image),
method: :delete, data: { confirm: 'Are you sure?' } %>
</li>
<% end %>
</ul>
<h2>Upload New Image</h2>
<%= simple_form_for [@current_user, @images.new] do |f| %>
<%= f.input :user_id, as: :hidden %>
<%= f.input :image, as: :file %>
<%= f.submit %>
<% end %>