OSDN Git Service

temp
[pettanr/pettanr.git] / app / controllers / scrolls_controller.rb
index 825e153..863243e 100644 (file)
@@ -9,17 +9,13 @@ class ScrollsController < ApplicationController
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
   before_filter :authenticate_admin!, :only => [:list, :browse]
-
-  @@model = Scroll
+  
+  def self.model
+    Scroll
+  end
+  
   def index
-    set_filer
-
-    respond_to do |format|
-      format_filer format
-      format.json { render json: @items.to_json(@@model.list_json_opt) }
-      format.atom 
-      format.rss
-    end
+    public_list
   end
 
   def show
@@ -33,7 +29,12 @@ class ScrollsController < ApplicationController
         end
       }
       format.json { render json: @item.to_json(Scroll.show_json_opt) }
-      format_prof format
+      format.prof { 
+        @profiler = @@profiler_manager.open(@item, @operators)
+        render :template => 'system/prof', :locals => {
+          :profiler => @profiler
+        }
+      }
       format.atom 
       format.rss 
     end
@@ -119,7 +120,7 @@ class ScrollsController < ApplicationController
     @scroll = Scroll.new
     @scroll.supply_default 
     @scroll.attributes = params[:scroll]
-    @scroll.overwrite @author
+    @scroll.overwrite @operators
 
     respond_to do |format|
       if @scroll.save