OSDN Git Service

fix: omniauth twitter
[pettanr/pettanr.git] / app / controllers / scrolls_controller.rb
index 246411f..943d7d2 100644 (file)
@@ -1,13 +1,13 @@
 class ScrollsController < 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 => [
       :top, :index, :show, :play, :by_panel, :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,11 +15,11 @@ class ScrollsController < ApplicationController
   end
   
   def by_author
-    filer_list
+    filer_list param: params[:id]
   end
   
   def by_panel
-    filer_list
+    filer_list param: params[:id]
   end
   
   def show_html_format format
@@ -47,10 +47,10 @@ class ScrollsController < ApplicationController
       format.html {
         if @item.own? @operators
           @fresh_panel_items = assist_items('panels', 'index')
-          @new_panel_items = assist_items('home', 'panels')
+          @new_panel_items = assist_items('home', 'panels', finder: :find_private, param: @operators)
         end
       }
-      list_json_format @list, format
+      list_json_format @finder, format
     end
   end
   
@@ -66,14 +66,14 @@ class ScrollsController < ApplicationController
     set_model
     @item = @my_model_class.new
     @item.supply_default 
-    @item.attributes = params[@my_model_class.item_name]
+    @item.attributes = @item.permit_params params
     @item.overwrite @operators
     render_create
   end
   
   def update
     set_edit
-    @item.attributes = params[@my_model_class.item_name]
+    @item.attributes = @item.permit_params params
     @item.overwrite @operators
     render_update
   end