From 1365af18369ba8b80bac94a0a2e15bb55d843741 Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Sun, 20 Apr 2014 17:26:51 +0200 Subject: Fix code indentation and improve formatting in the Getting Started Guide. This PR regroups #14817, #14818 and #14819 into one commit. [skip ci] --- guides/source/getting_started.md | 110 ++++++++++++++++++++++----------------- 1 file changed, 63 insertions(+), 47 deletions(-) (limited to 'guides/source/getting_started.md') diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md index e7880ca642..542e402ca1 100644 --- a/guides/source/getting_started.md +++ b/guides/source/getting_started.md @@ -1028,17 +1028,21 @@ something went wrong. To do that, you'll modify ```html+erb <%= form_for :article, url: articles_path do |f| %> + <% if @article.errors.any? %> -
-

<%= pluralize(@article.errors.count, "error") %> prohibited - this article from being saved:

- -
+
+

+ <%= pluralize(@article.errors.count, "error") %> prohibited + this article from being saved: +

+ +
<% end %> +

<%= f.label :title %>
<%= f.text_field :title %> @@ -1052,6 +1056,7 @@ something went wrong. To do that, you'll modify

<%= f.submit %>

+ <% end %> <%= link_to 'Back', articles_path %> @@ -1100,17 +1105,21 @@ it look as follows:

Editing article

<%= form_for :article, url: article_path(@article), method: :patch do |f| %> + <% if @article.errors.any? %> -
-

<%= pluralize(@article.errors.count, "error") %> prohibited - this article from being saved:

- -
+
+

+ <%= pluralize(@article.errors.count, "error") %> prohibited + this article from being saved: +

+ +
<% end %> +

<%= f.label :title %>
<%= f.text_field :title %> @@ -1124,6 +1133,7 @@ it look as follows:

<%= f.submit %>

+ <% end %> <%= link_to 'Back', articles_path %> @@ -1187,14 +1197,14 @@ it appear next to the "Show" link: -<% @articles.each do |article| %> - - <%= article.title %> - <%= article.text %> - <%= link_to 'Show', article_path(article) %> - <%= link_to 'Edit', edit_article_path(article) %> - -<% end %> + <% @articles.each do |article| %> + + <%= article.title %> + <%= article.text %> + <%= link_to 'Show', article_path(article) %> + <%= link_to 'Edit', edit_article_path(article) %> + + <% end %> ``` @@ -1228,17 +1238,21 @@ content: ```html+erb <%= form_for @article do |f| %> + <% if @article.errors.any? %> -
-

<%= pluralize(@article.errors.count, "error") %> prohibited - this article from being saved:

- -
+
+

+ <%= pluralize(@article.errors.count, "error") %> prohibited + this article from being saved: +

+ +
<% end %> +

<%= f.label :title %>
<%= f.text_field :title %> @@ -1252,6 +1266,7 @@ content:

<%= f.submit %>

+ <% end %> ``` @@ -1333,16 +1348,17 @@ together. -<% @articles.each do |article| %> - - <%= article.title %> - <%= article.text %> - <%= link_to 'Show', article_path(article) %> - <%= link_to 'Edit', edit_article_path(article) %> - <%= link_to 'Destroy', article_path(article), - method: :delete, data: { confirm: 'Are you sure?' } %> - -<% end %> + <% @articles.each do |article| %> + + <%= article.title %> + <%= article.text %> + <%= link_to 'Show', article_path(article) %> + <%= link_to 'Edit', edit_article_path(article) %> + <%= link_to 'Destroy', article_path(article), + method: :delete, + data: { confirm: 'Are you sure?' } %> + + <% end %> ``` @@ -1552,8 +1568,8 @@ So first, we'll wire up the Article show template

<% end %> -<%= link_to 'Back', articles_path %> -| <%= link_to 'Edit', edit_article_path(@article) %> +<%= link_to 'Back', articles_path %> | +<%= link_to 'Edit', edit_article_path(@article) %> ``` This adds a form on the `Article` show page that creates a new comment by -- cgit v1.2.3