From a52e2bed8634531272018a4ae7ba389e1feebdf5 Mon Sep 17 00:00:00 2001 From: Yoshiyuki Hirano Date: Sat, 16 Sep 2017 08:33:57 +0900 Subject: 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. --- guides/source/layouts_and_rendering.md | 36 ++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'guides/source') 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

Listing Books

- - - - - - - - -<% @books.each do |book| %> - - - - - - - -<% end %> + + + + + + + + + + <% @books.each do |book| %> + + + + + + + + <% end %> +
TitleSummary
<%= book.title %><%= book.content %><%= link_to "Show", book %><%= link_to "Edit", edit_book_path(book) %><%= link_to "Remove", book, method: :delete, data: { confirm: "Are you sure?" } %>
TitleContent
<%= book.title %><%= book.content %><%= link_to "Show", book %><%= link_to "Edit", edit_book_path(book) %><%= link_to "Destroy", book, method: :delete, data: { confirm: "Are you sure?" } %>

-- cgit v1.2.3