我目前正在使用社区引擎来发布社区,但我需要添加一些模型。在轨上访问插件帮助程序方法和lib
的问题是,我需要通过CE使用的助手方法,但是当我尝试访问该网站的新栏目,我得到一个未定义的方法(如下面)
undefined method `logged_in?' for #<ActionView::Base:0x1048f3748>
的LOGGED_IN ?方法是在供应商/插件/ community_engine/lib中/ authenticated_system.rb
这些方法被定义为一个辅助方法是这样的:
# this is at vendor/plugins/community_engine/lib/authenticated_system.rb
def self.included(base)
base.send :helper_method, :current_user, :current_user_session, :logged_in?, :admin?, :moderator?
end
我怎样才能让我的Rails应用程序加载的所有助手和方法在lib中声明我的插件?
你在'ApplicationController'中包含了AuthenticatedSystem吗? – 2010-02-27 19:33:17
我可以添加AuthenticadedSystem,因为这是一个模块,但我不能包含/需要助手= S任何想法? – Hock 2010-02-27 20:04:28