Forum: Ruby on Rails A plugin that responds to an action

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Chris S. (Guest)
on 2007-04-17 22:21
yo.  creating first plugin.
Is it not possible to create a plugin that defines controller actions?

<code>
module Foo
    def on_callback
        render_text 'foo', :layout => false
    end
end
ActionController::Base.send(:include, Foo)
.
.
.
http://url:3000/controller/on_callback
"ActionController::UnknownAction (No action responded to on_callback):"
</code>

but the following *will* work:
<code>

def ApplicationController < ActionController::Base
    include Foo
end
.
.
.
http://url:3000/controller/on_callback
'foo'
</code>
Chris S. (Guest)
on 2007-04-17 23:13
I found the answer to my question here
http://www.robbyonrails.com/xml/atom/article/22486/feed.xml

see "un-hiding actions" at bottom of page.
This topic is locked and can not be replied to.