基本上我想加载这个:
require "active_record/railtie"
require "active_resource/railtie"
require "action_mailer/railtie"
并且不加载action_controller
,因为在这种特殊情况下我没有用它。
查看Rails 的 master 中的代码,我可以看到:
# For now, action_controller must always be present with
# rails, so let's make sure that it gets required before
# here. This is needed for correctly setting up the middleware.
# In the future, this might become an optional require.
require "action_controller/railtie"
...所以我想知道:是否可以仅使用active_record
,active_resource
和加载 Rails action_mailer
,还是我总是必须加载action_controller
?