Rails.application.routes.draw do post "/store/check_module_permissions" => "client_sites#check_module_permissions" post "/store/register_old_sites_modules" => "client_sites#register_old_sites_modules" get "/store/check_for_rulingcom" => "client_sites#check_for_rulingcom" get "/store/desktop/widgets" => "client_sites#get_desktop_widget_list" get "/desktop/widget_download_url" => "client_sites#widget_download_url" get "/store/form_token" => 'client_sites#get_csrf_token' locales = Site.first.in_use_locales rescue I18n.available_locales scope "(:locale)", locale: Regexp.new(locales.join("|")) do namespace :admin do scope "sites/:id", :controller => 'official_module' do get "set_master_key" => 'official_module#set_master_key', as: :site_set_master_key patch "update_master_password" => 'official_module#update_master_password' end end end end