-
Notifications
You must be signed in to change notification settings - Fork 0
/
show.html.erb
35 lines (28 loc) · 1020 Bytes
/
show.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<h1><%= @series.title %></h1>
<p>
<%= link_to 'Add a book', new_series_book_path(@series) %>
</p>
<div class="container">
<div class="row">
<% @books.each do |book| %>
<div class="col-md-6 col-lg-4 col-xl-3 mb-3">
<div class="card">
<%= link_to book_path(book) do %>
<% if book.pages.count > 0 %>
<% if book.pages.first.picture.attached? %>
<%= image_tag book.pages.first.picture, class: "card-img-top"%>
<% end %>
<% end %>
<div class="card-body mt-2 p-0">
<h5 class="card-title text-center">Book <%= book.book_number %></h5>
</div>
<% end %>
</div>
</div>
<% end %>
</div>
</div>
<!-- TODO: Add these in for admin: -->
<%#= link_to 'Edit', edit_book_path(book) %>
<%#= link_to 'Destroy', book_path(book), method: :delete, data: { confirm: 'Are you sure?' } %>
<p><%= link_to 'Back', series_index_path %></p>