OSDN Git Service

fix: any
[pettanr/pettanr.git] / app / controllers / license_groups_controller.rb
index 7c852cf..28f6379 100644 (file)
@@ -1,19 +1,18 @@
 class LicenseGroupsController < ApplicationController
   if Manifest.manifest.magic_numbers['run_mode'] == 0
   else
-    before_filter :authenticate_reader, :only => [
-      :by_resource_picture, 
-      :count_by_resource_picture, 
+    before_action :authenticate_reader, :only => [
+      :by_resource_picture
     ]
   end
-  before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy]
+  before_action :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy]
   
   def index
     filer_list
   end
   
   def by_resource_picture
-    filer_list
+    filer_list param: params[:id]
   end
   
   def show_html_format format
@@ -31,14 +30,6 @@ class LicenseGroupsController < ApplicationController
     end
   end
   
-  def count
-    list_count
-  end
-  
-  def count_by_resource_picture
-    list_count
-  end
-  
   def new
     form_new
   end
@@ -52,7 +43,7 @@ class LicenseGroupsController < ApplicationController
     @item = @my_model_class.new
     @item.supply_default 
     @my_model_class.fold_extend_settings params[@my_model_class.item_name]
-    @item.attributes = params[@my_model_class.item_name]
+    @item.attributes = @item.permit_params params
     @item.overwrite 
     render_create
   end
@@ -60,9 +51,15 @@ class LicenseGroupsController < ApplicationController
   def update
     set_edit
     @my_model_class.fold_extend_settings params[@my_model_class.item_name]
-    @item.attributes = params[@my_model_class.item_name]
+    @item.attributes = @item.permit_params params
     @item.overwrite 
     render_update
   end
   
+  def destroy
+    set_model
+    @item = @my_model_class.edit(params[:id], @operators)
+    render_destroy '/' + @my_model_class.path_name
+  end
+  
 end