1
0
mirror of https://github.com/danbee/my-images synced 2025-03-04 08:49:05 +00:00
my-images/app/views/albums/index.html.erb
2024-03-25 20:26:50 -05:00

30 lines
634 B
Plaintext

<% content_for :title do %>
<h1>My Albums</h1>
<% end %>
<h2>Albums</h2>
<ul class="images">
<% @albums.each do |album| %>
<li>
<%= link_to album_images_path(album), class: :album do %>
<% if album.images.any? %>
<%= image_tag(album.images.first.image.thumb('200x200#').url) %>
<% else %>
<%= image_tag(asset_path("album.svg")) %>
<% end %>
<%= album.title %>
<% end %>
</li>
<% end %>
</ul>
<h2>Create New Album</h2>
<%= simple_form_for @albums.new do |f| %>
<%= f.input :user_id, as: :hidden %>
<%= f.input :title %>
<%= f.submit %>
<% end %>