mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Use head :no_content on the guides as well.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user