5261: Fix {redirect_to @object} usage.
authorTom Clegg <tom@curoverse.com>
Thu, 5 Mar 2015 20:09:11 +0000 (15:09 -0500)
committerTom Clegg <tom@curoverse.com>
Thu, 5 Mar 2015 20:09:11 +0000 (15:09 -0500)
apps/workbench/app/controllers/application_controller.rb

index 0a13fa6b601d2d45a8eac3d0a18d0b2c951584e6..523ef7f7815d922e7009224d65cb5b2102eb1cd3 100644 (file)
@@ -269,6 +269,9 @@ class ApplicationController < ActionController::Base
 
   def redirect_to uri, *args
     if request.xhr?
+      if not uri.is_a? String
+        uri = polymorphic_url(uri)
+      end
       render json: {href: uri}
     else
       super