我想为我的 Devise 登录页面设置布局,所以我在我的 ApplicationController 中添加了以下内容:
class ApplicationController < ActionController::Base
protect_from_forgery
if devise_controller?
layout "single_column_with_banner"
end
end
但是,我收到以下错误: 未定义的方法 `devise_controller?' 对于应用程序控制器:类
我可以看到在 devise.rb 中指定了辅助方法,但我无法从应用程序控制器访问它。我正在使用 Rails 3.2(正在从 2.3 迁移)。我应该在哪里看的任何线索?作为最后的手段,我可以覆盖 SessionsController 但我还不想这样做。