send jsonp errors with callbacks so they load

This commit is contained in:
Emi Matchu 2010-06-26 16:20:51 -04:00
parent fbba36005e
commit a0a1a94e96

View file

@ -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