send jsonp errors with callbacks so they load
This commit is contained in:
parent
fbba36005e
commit
a0a1a94e96
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue