Update archive_files_controller.rb

finish
This commit is contained in:
chiu 2019-09-19 19:15:12 +08:00
parent ed6def2dcf
commit 6c516780ab
1 changed files with 2 additions and 4 deletions

View File

@ -8,7 +8,6 @@ class Admin::ArchiveFilesController < OrbitAdminController
end end
end end
def save_categories_order def save_categories_order
begin
keys = params['data_keys'] keys = params['data_keys']
values = params['data_values'] values = params['data_values']
keys.each do |key| keys.each do |key|
@ -19,11 +18,10 @@ class Admin::ArchiveFilesController < OrbitAdminController
puts archivecategory.inspect puts archivecategory.inspect
if !(values[index].empty?) if !(values[index].empty?)
archivecategory.first.update_attributes(sort_number: values[index].to_i) archivecategory.first.update_attributes(sort_number: values[index].to_i)
else
archivecategory.first.update_attributes(sort_number: nil)
end end
end end
rescue => e
puts e
end
render :json => {}.to_json render :json => {}.to_json
end end
def index def index