OSDN Git Service

fix: local manifest/add helper
[pettanr/pettanr.git] / app / controllers / resource_pictures_controller.rb
index bae6ac7..437ae21 100644 (file)
@@ -4,7 +4,8 @@ class ResourcePicturesController < ApplicationController
     before_filter :authenticate_artist, :only => [:new, :create, :update, :destroy]
   else
     before_filter :authenticate_resource_reader, :only => [
-      :index, :show, :credit, :by_license_group, :by_license, :by_artist, :count, :count_by_license_group, :count_by_license, :count_by_artist
+      :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]
@@ -14,6 +15,10 @@ class ResourcePicturesController < ApplicationController
     filer_list
   end
   
+  def by_original_picture
+    filer_list
+  end
+  
   def by_license_group
     filer_list
   end
@@ -53,22 +58,6 @@ class ResourcePicturesController < ApplicationController
     end
   end
   
-  def count
-    list_count
-  end
-  
-  def count_by_license_group
-    list_count
-  end
-  
-  def count_by_license
-    list_count
-  end
-  
-  def count_by_artist
-    list_count
-  end
-  
   def new
     # use @item, @original_picture
     respond_to do |format|
@@ -110,7 +99,9 @@ class ResourcePicturesController < ApplicationController
     respond_to do |format|
       if @resource_picture.unpublish
         format.html { redirect_to :controller => '/home', :action => :resource_pictures }
-        format.json { head :ok }
+        format.json {
+          render json: '{}', status: :ok
+        }
       else
         format.html { redirect_to resource_picture_path(@resource_picture) }
         format.json { render json: @resource_picture.errors, status: :unprocessable_entity }