Rails.application.routes.draw do if ENV['worker_num']=='0' && File.basename($0) != 'rake' && !Rails.const_defined?('Console') Thread.new do c = HncCancerPredictfields.last if c sleep(5) c.save c.auto_write_predict_js end end end locales = Site.first.in_use_locales rescue I18n.available_locales scope "(:locale)", locale: Regexp.new(locales.join("|")) do namespace :admin do get 'hnc_cancer_predicts' , to: 'hnc_cancer_predicts#index' get 'editHncCancerPredicts' , to: 'hnc_cancer_predicts#edit' post 'editHncCancerPredicts' , to: 'hnc_cancer_predicts#edit' patch 'editHncCancerPredicts' , to: 'hnc_cancer_predicts#edit' get 'hnc_cancer_predicts/showSubmit' , to: 'hnc_cancer_predicts#showSubmit' get 'hnc_cancer_predicts/export_cancer_tool_record' , to: 'hnc_cancer_predicts#export_cancer_tool_record' resources :hnc_cancer_predicts end get "hnc_cancer_predictResult", to: "hnc_cancer_predicts#calculate" post "hnc_cancer_predictResult", to: "hnc_cancer_predicts#calculate" end end