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 resources :nkuht_donates do collection do get 'export' end member do get 'set_write_off' end end resources :nkuht_donate_units do collection do post 'delete_units' end end resources :nkuht_donate_departments do collection do post 'delete_departments' end end resources :nkuht_donate_uses do collection do post 'delete_uses' end end end resources :nkuht_donates end end