我有問題,嘗試添加靜態子域,同時運行公寓寶石..添加靜態子域公寓租戶軌之外4
基本上我想要做的事,如:
constraints subdomain: 'docs' do
get 'some/page'
end
然而,我在我的路線文件放在這個代碼,並試圖去docs.mysite.co我得到以下錯誤:
Apartment::TenantNotFound at/
One of the following schema(s) is invalid: "docs" "public", "shared_extensions"
我的整個路線文件如下:
class SubdomainPresent
def self.matches?(request)
request.subdomain.present?
end
end
class SubdomainBlank
def self.matches?(request)
request.subdomain.blank?
end
end
Rails.application.routes.draw do
constraints subdomain: 'docs' do
get 'some/page'
end
constraints(SubdomainPresent) do
mount ImageUploader::UploadEndpoint => "/images/upload"
root 'account_dashboard#index'
devise_for :users
devise_scope :user do
get 'login', to: 'devise/sessions#new'
end
resources :accounts
end
constraints(SubdomainBlank) do
require 'sidekiq/web'
mount Sidekiq::Web => '/sidekiq'
root 'visitor#index'
resources :accounts, only: [:new, :create]
end
end
在這裏的任何幫助將不勝感激!請讓我知道,如果我需要添加更多的信息!
編輯#1又添application.rb中
require_relative 'boot'
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module PatrolVault20161116Web
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
config.active_job.queue_adapter = :sidekiq
end
end
你能顯示你的application.rb嗎? – titan
抱歉@titan虐待現在添加。 –