I am currently delevoping a community using Community Engine, but I need to add some models.
The problem is that I need the helpers methods that are used by CE, but when I try to access the new sections of the site, I get a undefined method (like below)
undefined method `logged_in?' for #<ActionView::Base:0x1048f3748>
The logged_in? method is at vendor/plugins/community_engine/lib/authenticated_system.rb
These method is defined as a helper method like this:
# 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
How can I make my rails application load all the helpers and the methods declared in lib of my plugins?
You can edit your file vendor/plugins/community_engine/init.rb and add this line to load it:
and move you helper in your folder vendor/plugins/community_engine/helpers
Hope this help!