我目前正在使用社區引擎來發布社區,但我需要添加一些模型。在軌上訪問插件幫助程序方法和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