22 lines
619 B
HTML
22 lines
619 B
HTML
|
<h2>Full example</h2>
|
||
|
<pre><code><%# index.erb %>
|
||
|
<h1>Listing Books</h1>
|
||
|
<table>
|
||
|
<tr>
|
||
|
<th>Title</th>
|
||
|
<th>Summary</th>
|
||
|
<th></th>
|
||
|
<th></th>
|
||
|
<th></th>
|
||
|
</tr>
|
||
|
|
||
|
<% @books.each do |book| %>
|
||
|
<tr>
|
||
|
<td><%= book.title %></td>
|
||
|
<td><%= book.content %></td>
|
||
|
<td><%= link_to "Show", book %></td>
|
||
|
<td><%= link_to "Edit", edit_book_path(book) %></td>
|
||
|
<td><%= link_to "Remove", book, method: :delete, data: { confirm: "Are you sure?" } %></td>
|
||
|
</tr>
|
||
|
<% end %>
|
||
|
</table></code></pre>
|