OSDN Git Service

fix: fetch fail
[pettanr/pettanr.git] / app / controllers / scroll_panels_controller.rb
index a35d0b3..a2811ad 100644 (file)
@@ -1,13 +1,13 @@
 class ScrollPanelsController < ApplicationController
   if Manifest.manifest.magic_numbers['run_mode'] == 0
-    before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
-    before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
+    before_action :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
+    before_action :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   else
-    before_filter :authenticate_reader, :only => [
+    before_action :authenticate_reader, :only => [
       :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]
+    before_action :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
+    before_action :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
   
   def index
@@ -15,15 +15,15 @@ class ScrollPanelsController < ApplicationController
   end
   
   def by_panel
-    filer_list
+    filer_list param: params[:id]
   end
   
   def by_scroll
-    filer_list
+    filer_list param: params[:id]
   end
   
   def by_author
-    filer_list
+    filer_list param: params[:id]
   end
   
   def show
@@ -46,7 +46,7 @@ class ScrollPanelsController < ApplicationController
     set_model
     @item = @my_model_class.new
     @item.supply_default
-    @item.attributes = params[@item.item_name]
+    @item.attributes = @item.permit_params params
     @item.overwrite @operators
     @binder = @my_model_class.binder_model.edit(@item.binder_id, @operators) if @item.binder_id
     @panel = @my_model_class.destination_model.show(@item.destination_id, @operators) if @item.destination_id
@@ -58,7 +58,7 @@ class ScrollPanelsController < ApplicationController
     set_model
     @item = @my_model_class.edit(params[:id], @operators)
     ot = @item.t
-    @item.attributes = params[@item.item_name]
+    @item.attributes = @item.permit_params params
     @item.overwrite @operators
     @binder = @my_model_class.binder_model.edit(@item.binder_id, @operators) if @item.binder_id
     # no check permission for destination