Rails.application.routes.draw do locales = Site.first.in_use_locales rescue I18n.available_locales scope "(:locale)", locale: Regexp.new(locales.join("|")) do namespace :admin do get 'cancerpredicts' , to: 'cancerpredicts#index' resources :cancerpredicts end end end