diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-08-14 02:13:00 -0300 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-08-14 13:17:32 +0200 |
commit | b95d6e84b00bd926b1118f6a820eca7a870b8c35 (patch) | |
tree | 0753080f3b0dabbe0b2f62abe044c24d6b4ed5c4 /railties/guides/source/getting_started.textile | |
parent | 36a84a4f15f29b41c7cac2f8de410055006a8a8d (diff) | |
download | rails-b95d6e84b00bd926b1118f6a820eca7a870b8c35.tar.gz rails-b95d6e84b00bd926b1118f6a820eca7a870b8c35.tar.bz2 rails-b95d6e84b00bd926b1118f6a820eca7a870b8c35.zip |
Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;)
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> |