add rebuild the status of filefield in the mongo.

fix the problem about copying dir when lacking that dir.
This commit is contained in:
chiu committed 2019-10-28 21:39:32 +08:00
1 parent fcfcd7d058
commit ae85fe2859
3 files changed
+18 -1

No files matched your search

@@ -21,7 +21,13 @@ class Admin::PatchfilesController < OrbitAdminController
end
def edit
params["filefield"]["file_show"].each do |name,status|
@file_to_show.file_show[name][:status] = status.to_i
@file_to_show.file_show[name][:status] = status.to_i rescue nil
end
if params["filefield"]["refresh_btn"] == "true"
@default_field = Filefield.new()
@file_to_show.file_show = @default_field.file_show
@file_to_show.save
redirect_to admin_patchfiles_path and return
end
params["filefield"]["sub_file_fields"].each do |name,files|
files.each do |index,file_and_status|