提交 f686d942 编写于 作者: J José Valim

Use head :no_content on the guides as well.

上级 4857339a
......@@ -62,7 +62,7 @@ def update
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 @@ def destroy
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>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册