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 post "bus_bookings/bookbus" => "bus_bookings#bookbus" resources :bus_bookings do get "reserve" get "export" get "duplicate" delete "cancel" end end end end