From a0a1a94e967d1ebc91aa9a5f9d67682001b53931 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sat, 26 Jun 2010 16:20:51 -0400 Subject: [PATCH] send jsonp errors with callbacks so they load --- app/controllers/items_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb index 5b532b63..ca35e5a4 100644 --- a/app/controllers/items_controller.rb +++ b/app/controllers/items_controller.rb @@ -18,9 +18,14 @@ class ItemsController < ApplicationController rescue respond_to do |format| format.html { flash.now[:error] = $!.message } - format.js { render :json => {:error => $!.message}, :status => :bad_request, :callback => params[:callback] } + format.js { render :json => {:error => $!.message}, :callback => params[:callback] } end end + else + respond_to do |format| + format.html { render } + format.js { render :json => {:error => '$q required'}} + end end end