mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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.
This commit is contained in:
parent
81a2e1cb27
commit
a52e2bed86
1 changed files with 18 additions and 16 deletions
|
@ -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>
|
<h1>Listing Books</h1>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Title</th>
|
<th>Title</th>
|
||||||
<th>Summary</th>
|
<th>Content</th>
|
||||||
<th></th>
|
<th colspan="3"></th>
|
||||||
<th></th>
|
|
||||||
<th></th>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
<% @books.each do |book| %>
|
<tbody>
|
||||||
|
<% @books.each do |book| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= book.title %></td>
|
<td><%= book.title %></td>
|
||||||
<td><%= book.content %></td>
|
<td><%= book.content %></td>
|
||||||
<td><%= link_to "Show", book %></td>
|
<td><%= link_to "Show", book %></td>
|
||||||
<td><%= link_to "Edit", edit_book_path(book) %></td>
|
<td><%= link_to "Edit", edit_book_path(book) %></td>
|
||||||
<td><%= link_to "Remove", book, method: :delete, data: { confirm: "Are you sure?" } %></td>
|
<td><%= link_to "Destroy", book, method: :delete, data: { confirm: "Are you sure?" } %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
Loading…
Reference in a new issue