app/views/books/index.html.erb
<h1>Listing books</h1>
<table>
<% @books.each do |book| %>
<tr class="<%= cycle('list_line_odd', 'list_line_even') %>">
<td><%= image_tag(book.image_url, class: 'list_image') %></td>
<td class="list_description">
<dl>
<dt><%= book.title %></dt>
<dd><%= truncate(strip_tags(book.description), length: 80) %></dd>
</dl>
</td>
<td class="list_owners">
Owner:
<%= book.owner.name %> <br/>
Is lent to:
<%= book.lent_to.name %>
</td>
<td class="list_actions">
<%= link_to 'Show', book %> <br/>
<%= link_to 'Edit', edit_book_path(book) %> <br/>
<%= link_to 'Destroy', book,
method: :delete,
data: { confirm: 'Are you sure?' } %>
</td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New Book', new_book_path %>