aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorYoshiyuki Hirano <yhirano@me.com>2017-09-16 08:33:57 +0900
committerYoshiyuki Hirano <yhirano@me.com>2017-09-17 07:40:58 +0900
commita52e2bed8634531272018a4ae7ba389e1feebdf5 (patch)
tree7ed5bed5ad023d0ba0a9279e07aafbd1d0ed70d2 /guides
parent81a2e1cb278bccdf75591e454dfbbe476989f059 (diff)
downloadrails-a52e2bed8634531272018a4ae7ba389e1feebdf5.tar.gz
rails-a52e2bed8634531272018a4ae7ba389e1feebdf5.tar.bz2
rails-a52e2bed8634531272018a4ae7ba389e1feebdf5.zip
Update Layouts and Rendering in Rails [ci skip]
* 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.
Diffstat (limited to 'guides')
-rw-r--r--guides/source/layouts_and_rendering.md36
1 files changed, 19 insertions, 17 deletions
diff --git a/guides/source/layouts_and_rendering.md b/guides/source/layouts_and_rendering.md
index 76b325d0bf..fe2477f2ae 100644
--- a/guides/source/layouts_and_rendering.md
+++ b/guides/source/layouts_and_rendering.md
@@ -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>