diff options
author | José Valim <jose.valim@gmail.com> | 2011-10-26 09:40:49 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-11-09 19:06:02 -0200 |
commit | f686d9429fc964ca7ef0c7a8246ac25fd861a05b (patch) | |
tree | c4c4acf47706e1708ebdcb7a40ef2dd6599afe17 /railties | |
parent | 4857339aab4f725639347c55e56a75012bb81411 (diff) | |
download | rails-f686d9429fc964ca7ef0c7a8246ac25fd861a05b.tar.gz rails-f686d9429fc964ca7ef0c7a8246ac25fd861a05b.tar.bz2 rails-f686d9429fc964ca7ef0c7a8246ac25fd861a05b.zip |
Use head :no_content on the guides as well.
Diffstat (limited to 'railties')
-rw-r--r-- | railties/guides/code/getting_started/app/controllers/posts_controller.rb | 4 | ||||
-rw-r--r-- | railties/guides/source/getting_started.textile | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/railties/guides/code/getting_started/app/controllers/posts_controller.rb b/railties/guides/code/getting_started/app/controllers/posts_controller.rb index 7e903c984c..1581d4eb16 100644 --- a/railties/guides/code/getting_started/app/controllers/posts_controller.rb +++ b/railties/guides/code/getting_started/app/controllers/posts_controller.rb @@ -62,7 +62,7 @@ class PostsController < ApplicationController respond_to do |format| if @post.update_attributes(params[:post]) format.html { redirect_to @post, notice: 'Post was successfully updated.' } - format.json { head :ok } + format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @post.errors, status: :unprocessable_entity } @@ -78,7 +78,7 @@ class PostsController < ApplicationController respond_to do |format| format.html { redirect_to posts_url } - format.json { head :ok } + format.json { head :no_content } end end end diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile index bf6104b96b..ef80086eff 100644 --- a/railties/guides/source/getting_started.textile +++ b/railties/guides/source/getting_started.textile @@ -1060,7 +1060,7 @@ def update if @post.update_attributes(params[:post]) format.html { redirect_to(@post, :notice => 'Post was successfully updated.') } - format.json { render :json => {}, :status => :ok } + format.json { head :no_content } else format.html { render :action => "edit" } format.json { render :json => @post.errors, @@ -1089,7 +1089,7 @@ def destroy respond_to do |format| format.html { redirect_to posts_url } - format.json { head :ok } + format.json { head :no_content } end end </ruby> |