Update archive_files_controller.rb

fix error
This commit is contained in:
chiu 2019-09-19 19:03:33 +08:00
parent f42b175f8b
commit 233c9adc8f
1 changed files with 10 additions and 1 deletions

View File

@ -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