OSDN Git Service

temp
[pettanr/pettanr.git] / app / controllers / resource_pictures_controller.rb
index 3ba8579..6101420 100644 (file)
@@ -10,13 +10,30 @@ class ResourcePicturesController < ApplicationController
   end
   before_filter :authenticate_admin!, :only => [:list, :browse]
 
-  @@model = ResourcePicture
+  def self.model
+    ResourcePicture
+  end
+  def self.controller
+    Pettanr::Application::manifest.controller_managers[self.model.item_name]
+  end
+  def self.profiler_manager
+    Pettanr::Application::manifest.profiler_managers[self.model.item_name]
+  end
+  
   def index
-    set_filer
-
+    action_name = params[:action]
+    @action = self.class.controller.open(action_name, params, @operators)
+    @items = @action.items 
     respond_to do |format|
-      format_filer format
-      format.json { render :json => @items.to_json(@@model.list_json_opt) }
+      format.html {
+        @filer = @action.filer
+        render :template => 'system/filer', :locals => {
+          :filer => @filer
+        }
+      }
+      format.json { render json: @items.to_json(self.class.model.list_json_opt) }
+      format.atom 
+      format.rss
     end
   end