Permalink
Browse files

Make sure update and destroy actions return legal JSON

  • Loading branch information...
1 parent 5d39995 commit 5a3f5c0c7fd847bee0c4eb584acadde1b2e6792e @sarahmei committed May 28, 2012
Showing with 4 additions and 4 deletions.
  1. +2 −2 app/controllers/messages_controller.rb
  2. +2 −2 app/controllers/users_controller.rb
@@ -61,7 +61,7 @@ def update
respond_to do |format|
if @message.update_attributes(params[:message])
format.html { redirect_to(@message, :notice => 'Message was successfully updated.') }
- format.json { head :ok }
+ format.json { render :json => {} }
else
format.html { render :action => "edit" }
format.json { render :json => @message.errors, :status => :unprocessable_entity }
@@ -77,7 +77,7 @@ def destroy
respond_to do |format|
format.html { redirect_to(messages_url) }
- format.json { head :ok }
+ format.json { render :json => {} }
end
end
end
@@ -61,7 +61,7 @@ def update
respond_to do |format|
if @user.update_attributes(params[:user])
format.html { redirect_to(@user, :notice => 'User was successfully updated.') }
- format.json { head :ok }
+ format.json { render :json => {} }
else
format.html { render :action => "edit" }
format.json { render :json => @user.errors, :status => :unprocessable_entity }
@@ -77,7 +77,7 @@ def destroy
respond_to do |format|
format.html { redirect_to(users_url) }
- format.json { head :ok }
+ format.json { render :json => {} }
end
end
end

0 comments on commit 5a3f5c0

Please sign in to comment.