OSDN Git Service

fix new element dialog
[pettanr/pettanr.git] / app / controllers / scroll_panels_controller.rb
index dc94d9b..17532a7 100644 (file)
@@ -4,15 +4,11 @@ class ScrollPanelsController < ApplicationController
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   else
     before_filter :authenticate_reader, :only => [
-      :index, :show, :by_panel, :by_scroll, :by_author, :play, :count, :count_by_panel, :count_by_scroll, :count_by_author, :play
+      :index, :show, :by_panel, :by_scroll, :by_author
     ]
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
-
-  def self.model
-    ScrollPanel
-  end
   
   def index
     filer_list
@@ -30,10 +26,6 @@ class ScrollPanelsController < ApplicationController
     filer_list
   end
   
-  def play
-    filer_list
-  end
-  
   def show
     set_show
     respond_to do |format|
@@ -42,26 +34,6 @@ class ScrollPanelsController < ApplicationController
     end
   end
   
-  def count
-    list_count
-  end
-  
-  def count_by_panel
-    list_count
-  end
-  
-  def count_by_scroll
-    list_count
-  end
-  
-  def count_by_author
-    list_count
-  end
-  
-  def count_play
-    list_count
-  end
-  
   def new
     form_new
   end
@@ -71,7 +43,7 @@ class ScrollPanelsController < ApplicationController
   end
   
   def create
-    @my_model_class = self.class.model
+    set_model
     @item = @my_model_class.new
     @item.supply_default
     @item.attributes = params[@item.item_name]
@@ -83,7 +55,7 @@ class ScrollPanelsController < ApplicationController
   end
   
   def update
-    @my_model_class = self.class.model
+    set_model
     @item = @my_model_class.edit(params[:id], @operators)
     ot = @item.t
     @item.attributes = params[@item.item_name]