# A plugin that responds to an action

**URL:** <https://www.ruby-forum.com/t/a-plugin-that-responds-to-an-action/92283>\
**Category:** Rails\
**Created:** [April 17, 2007, 8:21pm UTC](https://www.ruby-forum.com/t/a-plugin-that-responds-to-an-action/92283 "2007-04-17T20:21:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yetanothergeek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/8e8cbc/32.png) [@yetanothergeek](https://www.ruby-forum.com/u/yetanothergeek)\
**Post date:** [April 17, 2007, 8:21pm UTC](https://www.ruby-forum.com/t/a-plugin-that-responds-to-an-action/92283/1 "2007-04-17T20:21:38Z")

</div>

yo. creating first plugin.  
Is it not possible to create a plugin that defines controller actions?

`
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):"
`

but the following _will_ work:  
``

`
`

`def ApplicationController < ActionController::Base
include Foo
end
.
.
.
http://url:3000/controller/on_callback
‘foo’
`

---

<div class="post-metadata">

**Author:** ![yetanothergeek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/8e8cbc/32.png) [@yetanothergeek](https://www.ruby-forum.com/u/yetanothergeek)\
**Post date:** [April 17, 2007, 9:13pm UTC](https://www.ruby-forum.com/t/a-plugin-that-responds-to-an-action/92283/2 "2007-04-17T21:13:03Z")

</div>

I found the answer to my question here  
[http://www.robbyonrails.com/xml/atom/article/22486/feed.xml](http://www.robbyonrails.com/xml/atom/article/22486/feed.xml)

see “un-hiding actions” at bottom of page.
