Skip to content

Commit

Permalink
Update Layouts and Rendering in Rails [ci skip]
Browse files Browse the repository at this point in the history
* The example code on this page are similar to ones generated
  by scaffold generator, but some points are different.

* Of course, it is no reason to be as same as scaffolding codes.
  But this is the guide for beginners, I thought it's better
  to be almost same as scaffolding codes.
  • Loading branch information
yhirano55 committed Sep 16, 2017
1 parent 81a2e1c commit a52e2be
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions guides/source/layouts_and_rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,25 @@ If we want to display the properties of all the books in our view, we can do so
<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 %>
<thead>
<tr>
<th>Title</th>
<th>Content</th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @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 "Destroy", book, method: :delete, data: { confirm: "Are you sure?" } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
Expand Down

0 comments on commit a52e2be

Please sign in to comment.