OSDN Git Service

fix test
[pettanr/pettanr.git] / app / controllers / application_controller.rb
index 7c00385..f1da1ce 100644 (file)
@@ -130,7 +130,12 @@ class ApplicationController < ActionController::Base
           :filer => @filer
         }
       }
-      format.json { render json: @items.to_json }
+      format.json { render json:  @items.map{|i| i.attributes}.to_json }
+      # rails3.2 has problem
+      # y method defined as private
+      # attribute y conflict at PanelPicture, balloon ..etc
+      # use i.attributes[name]
+      # format.json { render json:  @items.to_json }
       format.atom 
       format.rss
     end
@@ -172,7 +177,7 @@ class ApplicationController < ActionController::Base
   end
   
   def show_json_format_for_root format
-    format.json { render json: @item.to_json(@my_model_class.show_json_opt_for_root) }
+    format.json { render json: @item.attributes.to_json(@my_model_class.show_json_opt_for_root) }
   end
   
   def set_new