Rails.application.routes.draw do locales = Site.find_by(site_active: true).in_use_locales rescue I18n.available_locales scope "(:locale)", locale: Regexp.new(locales.join("|")) do namespace :admin do get 'writing_journal_setting' => "thesis_guidance_papers#setting" get 'thesis_guidance_papers/download_excel_format' => 'thesis_guidance_papers#excel_format' post 'thesis_guidance_papers/import_from_excel' => 'thesis_guidance_papers#import_from_excel' resources :thesis_guidance_papers do collection do post 'merge_process' => 'thesis_guidance_papers#merge_process' get 'merge' => 'thesis_guidance_papers#merge' get 'toggle_hide' => 'thesis_guidance_papers#toggle_hide' get 'analysis' get 'analysis_report' get "download_excel" end end resources :members do collection do scope '(:name-:uid)' do resources :thesis_guidance_papers do collection do get 'frontend_setting' => 'thesis_guidance_papers#frontend_setting' post 'update_frontend_setting' => 'thesis_guidance_papers#update_frontend_setting' end end end end end resources :thesis_guidance_levels resources :thesis_guidance_paper_author_types resources :thesis_guidance_paper_types resources :thesis_guidance_types resources :thesis_guidance_paper_intros end get "/xhr/personal_thesis_guidance/get_fields_for_index" => "personal_thesis_guidances#get_fields_for_index" post "/xhr/personal_thesis_guidance/save_index_fields" => "personal_thesis_guidances#save_index_fields" end end