Hi all,

currently I'm developing a plugin wich shoud hook into ActionController.
To do that, I'm using ActionController::Base.send(:include, ...) but
when I want to call the according methods from within a controller, I
get an MethodNotError.

The following code shows what I'm currently trying. Mixing the
ViewHelpers into ActionView::Base work's fine. The same I want to do
with ActionController:Base, but that does'n work:

[code]
#require 'widget_pool/loader'
require 'widget_pool/view_helpers'
require 'widget_pool/base'

module WidgetPool

  module Loader
    def load_widget name
      puts 'loading widget: ' + name.to_s
    end
  end

  class << self
    def enable
      puts 'starting widget_pool...'

      ActionView::Base.send :include, ViewHelpers
      ActionController::Base.send :include, Loader
    end
  end
end

WidgetPool.enable
[/code]

Does anybody know, what is missing to make it work?

Thanks & Greetings
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to