OSDN Git Service

add: license publisher
[pettanr/pettanr.git] / app / controllers / licenses_controller.rb
index dc31794..cd697dd 100644 (file)
@@ -1,12 +1,8 @@
 class LicensesController < ApplicationController
   before_filter :authenticate_resource_reader, :only => [
-    :by_license_group, :by_system_picture, :count_by_license_group, :count_by_system_picture
+    :by_license_group, :by_system_picture
   ]
   before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy]
-
-  def self.model
-    License
-  end
   
   def index
     filer_list
@@ -44,18 +40,6 @@ class LicensesController < ApplicationController
     end
   end
   
-  def count
-    list_count
-  end
-  
-  def count_by_license_group
-    list_count
-  end
-  
-  def count_by_system_picture
-    list_count
-  end
-  
   def new
     form_new
   end
@@ -83,11 +67,9 @@ class LicensesController < ApplicationController
   end
   
   def destroy
-    @item = self.class.model.edit(params[:id], @operators)
-    respond_to do |format|
-        flash[:notice] = I18n.t('flash.notice.not_destroyed', :model => self.class.model.model_name.human)
-        format.html { redirect_to @item }
-        format.json { render json: @item.errors, status: :unprocessable_entity }
-    end
+    set_model
+    @item = @my_model_class.edit(params[:id], @operators)
+    render_destroy '/' + @my_model_class.path_name
   end
+  
 end