X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=app%2Fcontrollers%2Fapplication_controller.rb;h=0d4ea695caf0f700a415239393438f7b97ba7eba;hb=6cbe57ca7a9cac83fad2f3c66fa097055c1fe803;hp=38e5c7f386ab6061844079a667b68bf62902b6a5;hpb=3e08dd3b1d0b84f2ad76c9a53bf6cad8b046ec62;p=pettanr%2Fpettanr.git diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 38e5c7f3..0d4ea695 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -112,6 +112,8 @@ class ApplicationController < ActionController::Base def set_list set_model + @my_list_model = Manifest.manifest.models[@my_action.item_name] + @my_list_model_class = @my_list_model.classify @list = Locmare::ListGroup.list @my_action.item_name, @my_action.list_name end @@ -128,15 +130,20 @@ 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 end def set_play - set_model - @list = Locmare::ListGroup.list @my_action.item_name, @my_action.list_name + set_list + @item = @my_model_class.show(params[:id], @operators) end def play_list @@ -158,7 +165,7 @@ class ApplicationController < ActionController::Base def show_prof_format format format.prof { self.formats = [:html] - @profiler = Locmare::Profiler.new @my_model.model_name, @item, @operators + @profiler = Locmare::Profiler.new @my_model_class.item_name, @item, @operators render @profiler.template_name, :locals => { :profiler => @profiler } @@ -170,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