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 :ruling_templates do member do get "upload_files" post "upload_image" get "get_temp_dir_name" delete "delete_image" end collection do post "change_image_order" post "upload_temp_file" end end end post "ruling_template" => 'ruling_templates#index' post "get_template_zip" => "ruling_templates#get_template_zip" end end