-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html.erb
23 lines (22 loc) · 985 Bytes
/
index.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
<div class="books-page">
<div class="container">
<div class="text-right"><%= link_to "Agregar Libro", new_book_path, class: "btn btn-primary rounded-0" %></div>
<% @books.each do |book| %>
<div class="book card flex-sm-row align-items-center align-items-sm-start mt-5">
<img src="<%= book.image_url %>" alt="<%= book.title %>">
<div class="card-body">
<h5 class="card-title">
<%= book.title %>
<small><%= book.author %></small>
</h5>
<p class="card-text"><%= book.description %></p>
<%= link_to "Detalles", book, class: "btn btn-primary" %>
<% if signed_in? %>
<%= link_to "Editar", edit_book_path(book), class: "btn btn-link" %>
<%= link_to "Eliminar", book, class: "btn btn-link text-danger", method: :delete, data: { confirm: "¿Estás seguro de eliminar este libro?" } %>
<% end %>
</div>
</div>
<% end %>
</div>
</div>