我有子域的路由设置这样路由错误基于铁路环境
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
轨希望my_controller
是在app/controllers/my
像这样定义:
class My::MyController < ApplicationController
layout "my"
before_filter :authenticate_user!
def index
end
end
显然,这是不实际的尝试和两者都做。有没有人对我做错了什么有什么想法?
无遗憾的是没有。使用'cache_classes = true'的生产设置时,它会返回错误:'未初始化的常量My :: MyController' – Jaijaz
对于我来说,它适用于您提供的配置设置。 Rails 3.2.8 – alex
在对开发环境文件进行更改后,您是否重新启动rails服务器?对我来说,如果我不这样做,但它显然没有采取新的设置。 – Jaijaz