3114: Fix href in json response for generic #create action too. See 7485476.
authorTom Clegg <tom@curoverse.com>
Mon, 18 Aug 2014 20:51:13 +0000 (16:51 -0400)
committerTom Clegg <tom@curoverse.com>
Mon, 18 Aug 2014 20:51:13 +0000 (16:51 -0400)
apps/workbench/app/controllers/application_controller.rb

index e38a32df041eebf543d2821cea85c0d3b27fad15..160730331dd28ec9495e933787e9e8d2c3dbb697 100644 (file)
@@ -248,7 +248,7 @@ class ApplicationController < ActionController::Base
     @object ||= model_class.new @new_resource_attrs, params["options"]
     if @object.save
       respond_to do |f|
-        f.json { render json: @object.attributes.merge(href: url_for(@object)) }
+        f.json { render json: @object.attributes.merge(href: url_for(action: :show, id: @object)) }
         f.html {
           redirect_to @object
         }