From ff1d1403261d8b520a58baef48567d3818c12cb8 Mon Sep 17 00:00:00 2001 From: Fernando Blat Date: Thu, 27 Jan 2011 18:30:57 +0100 Subject: [PATCH] Always return JSON --- app/controllers/api/json/tables_controller.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/api/json/tables_controller.rb b/app/controllers/api/json/tables_controller.rb index 239ba66532..58b4c8000f 100644 --- a/app/controllers/api/json/tables_controller.rb +++ b/app/controllers/api/json/tables_controller.rb @@ -101,7 +101,7 @@ class Api::Json::TablesController < ApplicationController format.json do begin @table.update_all(params) - render :nothing => true, :status => 200 + render :json => ''.to_json, :status => 200 rescue render :json => { :errors => @table.errors.full_messages}.to_json, :status => 400 end @@ -141,7 +141,7 @@ class Api::Json::TablesController < ApplicationController else @table.modify_column!(params[:column]) end - render :nothing => true, :status => 200 + render :json => ''.to_json, :status => 200 rescue => e render :json => { :errors => [e.message.split("\n").first] }.to_json, :status => 400 and return end @@ -175,7 +175,7 @@ class Api::Json::TablesController < ApplicationController @table.insert_row!(params) respond_to do |format| format.json do - render :nothing => true, :status => 200 + render :json => ''.to_json, :status => 200 end end end @@ -201,7 +201,7 @@ class Api::Json::TablesController < ApplicationController format.json do unless params[:row_id].blank? if resp = @table.update_row!(params[:row_id], params) - render :nothing => true, :status => 200 + render :json => ''.to_json, :status => 200 else case resp when 404 @@ -224,7 +224,7 @@ class Api::Json::TablesController < ApplicationController # * body: _nothing_ def delete @table.destroy - render :nothing => true, :status => 200 + render :json => ''.to_json, :status => 200 end # Create a new table