From 6c516780ab20ef782f9afa4c7d835c3a5b349e22 Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 19 Sep 2019 19:15:12 +0800 Subject: [PATCH] Update archive_files_controller.rb finish --- app/controllers/admin/archive_files_controller.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/controllers/admin/archive_files_controller.rb b/app/controllers/admin/archive_files_controller.rb index d698813..1efdb3b 100644 --- a/app/controllers/admin/archive_files_controller.rb +++ b/app/controllers/admin/archive_files_controller.rb @@ -8,7 +8,6 @@ class Admin::ArchiveFilesController < OrbitAdminController end end def save_categories_order - begin keys = params['data_keys'] values = params['data_values'] keys.each do |key| @@ -19,11 +18,10 @@ class Admin::ArchiveFilesController < OrbitAdminController puts archivecategory.inspect if !(values[index].empty?) archivecategory.first.update_attributes(sort_number: values[index].to_i) + else + archivecategory.first.update_attributes(sort_number: nil) end end - rescue => e - puts e - end render :json => {}.to_json end def index