diff options
Diffstat (limited to 'railties/guides/source/getting_started.textile')
-rw-r--r-- | railties/guides/source/getting_started.textile | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile index ffb0310816..270fbe76d2 100644 --- a/railties/guides/source/getting_started.textile +++ b/railties/guides/source/getting_started.textile @@ -475,13 +475,13 @@ After the console loads, you can use it to work with your application's models: <shell> >> p = Post.new(:content => "A new post") -=> #<Post id: nil, name: nil, title: nil, +=> #<Post id: nil, name: nil, title: nil, content: "A new post", created_at: nil, updated_at: nil> >> p.save => false >> p.errors -=> #<OrderedHash { :title=>["can't be blank", +=> #<OrderedHash { :title=>["can't be blank", "is too short (minimum is 5 characters)"], :name=>["can't be blank"] }> </shell> @@ -742,7 +742,7 @@ def update respond_to do |format| if @post.update_attributes(params[:post]) - format.html { redirect_to(@post, + format.html { redirect_to(@post, :notice => 'Post was successfully updated.') } format.xml { head :ok } else @@ -1056,7 +1056,7 @@ Then in the +app/views/posts/show.html.erb+ you can change it to look like the f </p> <h2>Comments</h2> -<%= render :partial => "comments/comment", +<%= render :partial => "comments/comment", :collection => @post.comments %> <h2>Add a comment:</h2> @@ -1127,7 +1127,7 @@ Then you make the +app/views/posts/show.html.erb+ look like the following: </p> <h2>Comments</h2> -<%= render :partial => "comments/comment", +<%= render :partial => "comments/comment", :collection => @post.comments %> <h2>Add a comment:</h2> @@ -1213,15 +1213,15 @@ Rails provides a very simple HTTP authentication system that will work nicely in <ruby> class ApplicationController < ActionController::Base protect_from_forgery - + private - + def authenticate authenticate_or_request_with_http_basic do |user_name, password| user_name == 'admin' && password == 'password' end end - + end </ruby> @@ -1381,7 +1381,7 @@ Finally, we will edit the <tt>app/views/posts/show.html.erb</tt> template to sho </p> <h2>Comments</h2> -<%= render :partial => "comments/comment", +<%= render :partial => "comments/comment", :collection => @post.comments %> <h2>Add a comment:</h2> @@ -1405,7 +1405,7 @@ Open up <tt>app/helpers/posts_helper.rb</tt> and add the following: <erb> module PostsHelper def join_tags(post) - post.tags.map { |t| t.name }.join(", ") + post.tags.map { |t| t.name }.join(", ") end end </erb> @@ -1436,7 +1436,7 @@ Now you can edit the view in <tt>app/views/posts/show.html.erb</tt> to look like </p> <h2>Comments</h2> -<%= render :partial => "comments/comment", +<%= render :partial => "comments/comment", :collection => @post.comments %> <h2>Add a comment:</h2> |