OSDN Git Service

fix: fetch fail
[pettanr/pettanr.git] / app / controllers / licenses_controller.rb
index 66b0423..b0f3007 100644 (file)
@@ -1,19 +1,19 @@
 class LicensesController < ApplicationController
-  before_filter :authenticate_resource_reader, :only => [
+  before_action :authenticate_resource_reader, :only => [
     :by_license_group, :by_system_picture
   ]
-  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_license_group
-    filer_list
+    filer_list param: params[:id]
   end
   
   def by_system_picture
-    filer_list
+    filer_list param: params[:id]
   end
   
   def show_html_format format
@@ -30,7 +30,7 @@ class LicensesController < ApplicationController
       show_json_format format
     end
   end
-
+  
   def search
     @licenses = License.list_by_name(params[:name])
     
@@ -53,7 +53,7 @@ class LicensesController < 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
@@ -61,7 +61,7 @@ class LicensesController < 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
@@ -69,7 +69,7 @@ class LicensesController < ApplicationController
   def destroy
     set_model
     @item = @my_model_class.edit(params[:id], @operators)
-    render_destroy @my_model_class.path_name
+    render_destroy '/' + @my_model_class.path_name
   end
   
 end