asia_database/config/routes.rb

51 lines
1.4 KiB
Ruby

Rails.application.routes.draw do
Thread.new do
AsiaTeacher.create_indexes
AsiaProject.create_indexes
AsiaPaper.create_indexes
AsiaPatent.create_indexes
AsiaTecTransfer.create_indexes
AsiaExhibition.create_indexes
AsiaExportStore.create_indexes
end
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 'asia_teacher_setting' => "asia_teachers#setting"
resources :asia_teachers do
collection do
get 'toggle_hide' => 'asia_teachers#toggle_hide'
get 'analysis'
get 'analysis_report'
get "download_excel"
end
end
resources :members do
collection do
scope '(:name-:uid)' do
resources :asia_teachers do
collection do
get 'frontend_setting' => 'asia_teachers#frontend_setting'
post 'update_frontend_setting' => 'asia_teachers#update_frontend_setting'
end
end
end
end
end
resources :asia_databases do
member do
get 'asia_teachers'
get 'asia_projects'
get 'asia_papers'
get 'asia_patents'
get 'asia_tec_transfers'
get 'asia_exhibitions'
end
end
end
post "/xhr/asia_database/export_excel" => "asia_databases#export_excel"
get "/xhr/asia_database/download_excel" => "asia_databases#download_excel"
post '/xhr/asia_database/get_store_status' => 'asia_databases#get_store_status'
end
end