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 get "/xhr/property_hires/check_availability" => "property_hires#check_availability" post "/xhr/property_hires/make_booking" => "property_hires#make_booking" patch "/xhr/property_hires/make_booking" => "property_hires#make_booking" get "/xhr/property_hires/get_bookings" => "property_hires#get_bookings" namespace :admin do get "property_hires/checkforthread", to: "property_hires#checkforthread" resources :property_hires do member do get 'copy' get "edit_location" patch "update_location" delete "destroy_location" get "show_booking_details" get "pass_booking" delete "delete_booking_details" get "edit_hire" patch "update_hire" get "custom_fields" get "fields_display_order" get "export_reservation_data" post "update_fields_display_order" patch "update_fields_display_order" end collection do get "my_bookings" get "settings" patch "settings" get "manage_locations" get "add_location" post "create_location" get "order" post "updateorder" end end end end end