lib/imperavi-rails.rb in imperavi-rails-0.0.3.beta vs lib/imperavi-rails.rb in imperavi-rails-0.0.4.beta

- old
+ new

@@ -1,8 +1,14 @@ require "imperavi-rails/engine" +require "imperavi-rails/controller_methods" +require File.join(File.dirname(__FILE__), '..', 'app', 'helpers', 'imperavi_rails', 'imperavi_helper') module ImperaviRails - if defined?(ActionController) - require File.join(File.dirname(__FILE__), '..', 'app', 'helpers', 'imperavi_rails', 'imperavi_helper') - ActionController::Base.helper(ImperaviHelper) + extend ActiveSupport::Autoload + + autoload :ControllerMethods + + ActiveSupport.on_load(:action_controller) do + helper ImperaviHelper + include ImperaviRails::ControllerMethods end end