eliminate extra layer {type: ...} in API responses
authorTom Clegg <tom@clinicalfuture.com>
Sun, 13 Jan 2013 21:52:03 +0000 (13:52 -0800)
committerTom Clegg <tom@clinicalfuture.com>
Sun, 13 Jan 2013 21:52:03 +0000 (13:52 -0800)
app/controllers/application_controller.rb

index e9d715b6534486a16e70e2279d100313d79968fc..dcd47a76efd25151a695b6bac5f21175f698ff41 100644 (file)
@@ -38,7 +38,7 @@ class ApplicationController < ActionController::Base
   end
 
   def show
-    render_for_api :superuser, json: @object
+    render json: @object.as_api_response(:superuser)
   end
 
   def create