我有这样的子域路由设置
constraints :subdomain => 'my' do
scope :module => 'my', :as => 'my' do
scope :module => 'author', :as => 'author' do
resources :modlette_author
end
resources :modlettes
root :to => 'my#index'
end
end
当我在开发环境中时,特别config.cache_classes = false
是 my_controller 需要坐下来app/controllers
并像这样定义:
class MyController < ApplicationController
layout "my"
before_filter :authenticate_user!
def index
end
end
然而,在生产中,当config.cache_classes = true
rails 想要my_controller
加入app/controllers/my
并定义如下:
class My::MyController < ApplicationController
layout "my"
before_filter :authenticate_user!
def index
end
end
显然,两者都尝试是不切实际的。有没有人对我做错了什么有任何想法?