aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/getting_started.textile
diff options
context:
space:
mode:
authorrohit <rohit.arondekar@gmail.com>2010-04-28 08:09:27 +0530
committerrohit <rohit.arondekar@gmail.com>2010-04-28 08:09:27 +0530
commitc6a83378519a7ee9e16adec0fe25736fd794d971 (patch)
tree6aaf170661a019904b04d53646e7d7466d414aa2 /railties/guides/source/getting_started.textile
parent033b1e68c070eca9da7ad216e56a2cbbaddba74d (diff)
downloadrails-c6a83378519a7ee9e16adec0fe25736fd794d971.tar.gz
rails-c6a83378519a7ee9e16adec0fe25736fd794d971.tar.bz2
rails-c6a83378519a7ee9e16adec0fe25736fd794d971.zip
added notice to all samples of show.html.erb of posts controller
Diffstat (limited to 'railties/guides/source/getting_started.textile')
-rw-r--r--railties/guides/source/getting_started.textile14
1 files changed, 14 insertions, 0 deletions
diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index 36e37a1c5d..ff79d9c0ab 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -686,6 +686,8 @@ end
The +show+ action uses +Post.find+ to search for a single record in the database by its id value. After finding the record, Rails displays it by using +show.html.erb+:
<erb>
+<p class="notice"><%= notice %></p>
+
<p>
<b>Name:</b>
<%= @post.name %>
@@ -899,6 +901,8 @@ Like with any blog, our readers will create their comments directly after readin
So first, we'll wire up the Post show template (+/app/views/posts/show.html.erb+) to let us make a new comment:
<erb>
+<p class="notice"><%= notice %></p>
+
<p>
<b>Name:</b>
<%= @post.name %>
@@ -954,6 +958,8 @@ In addition, the code takes advantage of some of the methods available for an as
Once we have made the new comment, we send the user back to the +post_path(@post)+ URL. This runs the +show+ action of the +PostsController+ which then renders the +show.html.erb+ template where we want the comment to show, so then, we'll add that to the +app/view/posts/show.html.erb+.
<erb>
+<p class="notice"><%= notice %></p>
+
<p>
<b>Name:</b>
<%= @post.name %>
@@ -1030,6 +1036,8 @@ First will make a comment partial to extract showing all the comments for the po
Then in the +app/views/posts/show.html.erb+ you can change it to look like the following:
<erb>
+<p class="notice"><%= notice %></p>
+
<p>
<b>Name:</b>
<%= @post.name %>
@@ -1099,6 +1107,8 @@ Lets also move that new comment section out to it's own partial, again, you crea
Then you make the +app/views/posts/show.html.erb+ look like the following:
<erb>
+<p class="notice"><%= notice %></p>
+
<p>
<b>Name:</b>
<%= @post.name %>
@@ -1337,6 +1347,8 @@ Now create the folder <tt>app/views/tags</tt> and make a file in there called <t
Finally, we will edit the <tt>app/views/posts/show.html.erb</tt> template to show our tags.
<erb>
+<p class="notice"><%= notice %></p>
+
<p>
<b>Name:</b>
<%= @post.name %>
@@ -1390,6 +1402,8 @@ end
Now you can edit the view in <tt>app/views/posts/show.html.erb</tt> to look like this:
<erb>
+<p class="notice"><%= notice %></p>
+
<p>
<b>Name:</b>
<%= @post.name %>