OSDN Git Service

fix: finder
[pettanr/pettanr.git] / app / controllers / resource_pictures_controller.rb
index 27b1b31..a392b4c 100644 (file)
@@ -1,14 +1,14 @@
 class ResourcePicturesController < ApplicationController
   if Manifest.manifest.magic_numbers['run_mode'] == 0
-    before_filter :authenticate_user, :only => [:new, :create, :update, :destroy]
-    before_filter :authenticate_artist, :only => [:new, :create, :update, :destroy]
+    before_action :authenticate_user, :only => [:new, :create, :update, :destroy]
+    before_action :authenticate_artist, :only => [:new, :create, :update, :destroy]
   else
-    before_filter :authenticate_resource_reader, :only => [
+    before_action :authenticate_resource_reader, :only => [
       :index, :show, :credit, 
       :by_original_picture, :by_license_group, :by_license, :by_artist
     ]
-    before_filter :authenticate_user, :only => [:new, :create, :update, :destroy]
-    before_filter :authenticate_artist, :only => [:new, :create, :update, :destroy]
+    before_action :authenticate_user, :only => [:new, :create, :update, :destroy]
+    before_action :authenticate_artist, :only => [:new, :create, :update, :destroy]
   end
   
   def index
@@ -16,19 +16,19 @@ class ResourcePicturesController < ApplicationController
   end
   
   def by_original_picture
-    filer_list
+    filer_list param: params[:id]
   end
   
   def by_license_group
-    filer_list
+    filer_list param: params[:id]
   end
   
   def by_license
-    filer_list
+    filer_list param: params[:id]
   end
   
   def by_artist
-    filer_list
+    filer_list param: params[:id]
   end
   
   def show_html_format format
@@ -72,12 +72,12 @@ class ResourcePicturesController < ApplicationController
     if params[:json]
       jsn = JSON.parse_no_except(params[:json])
     end
+    @item = @original_picture.resource_picture || ResourcePicture.new
     @prm = if params[:resource_picture] == nil or params[:resource_picture].empty?
-       jsn
+      jsn
     else
-       params[:resource_picture]
+      @item.permit_params(params)
     end
-    @item = @original_picture.resource_picture || ResourcePicture.new
     @item.attributes = @prm
     @item.overwrite @original_picture
     @item.boosts 'post'