diff --git a/app/controllers/admin/archive_files_controller.rb b/app/controllers/admin/archive_files_controller.rb index 0b72119..59b217c 100644 --- a/app/controllers/admin/archive_files_controller.rb +++ b/app/controllers/admin/archive_files_controller.rb @@ -8,7 +8,16 @@ class Admin::ArchiveFilesController < OrbitAdminController end end def save_categories_order - puts ['1test2',params.inspect] + keys = params['data_keys'] + values = params['data_values'] + keys.each do |key| + key.slice! 'sort_number-' + end + keys.each_with_index do |key,index| + archivecategory = ArchiveCategory.all.where(category_id: key) + archivecategory.first.sort_number = values[index] + archivecategory.first.save! + end render :json => {}.to_json end def index