Rails.application.routes.draw do locales = Site.first.in_use_locales rescue I18n.available_locales # scope "(:locale)", locale: Regexp.new(locales.join("|")) do get "/xhr/announcement_link_widget/content" => "announcement_link_widgets#content" # end end