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 'course_setting' => "courses#setting" resources :courses do collection do get 'toggle_hide' => 'courses#toggle_hide' end end resources :members do collection do scope '(:name-:uid)' do resources :courses do collection do get 'frontend_setting' => 'courses#frontend_setting' post 'update_frontend_setting' => 'courses#update_frontend_setting' end end end end end resources :course_semesters resources :course_categories post "course_categories/update_order" => "course_categories#update_order" end end end