OSDN Git Service

mrg
[pettanr/pettanr.git] / app / controllers / application_controller.rb
index 0d4ea69..bbdd2e8 100644 (file)
@@ -143,7 +143,10 @@ class ApplicationController < ActionController::Base
   
   def set_play
     set_list
-    @item = @my_model_class.show(params[:id], @operators)
+    @binder_controller = Manifest.manifest.controllers[params[:controller].to_s]
+    @binder_model = Manifest.manifest.models[@binder_controller.item_name]
+    @binder_model_class = @binder_model.classify
+    @item = @binder_model_class.show(params[:id], @operators)
   end
   
   def play_list
@@ -177,7 +180,7 @@ class ApplicationController < ActionController::Base
   end
   
   def show_json_format_for_root format
-    format.json { render json: @item.attributes.to_json(@my_model_class.show_json_opt_for_root) }
+    format.json { render json: @item.to_json(@my_model_class.show_json_opt_for_root) }
   end
   
   def set_new