OSDN Git Service

rails upgrade to 4 for js
[pettanr/pettanr.git] / app / controllers / resource_pictures_controller.rb
index 60972c4..549e779 100644 (file)
@@ -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
     else
-      @item.permit_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'