# \[Plugin dev.\] Hook into ActionController::Base properly

**URL:** <https://discuss.rubyonrails.org/t/plugin-dev-hook-into-actioncontroller-base-properly/43638>\
**Category:** rubyonrails-talk\
**Created:** [June 20, 2009, 9:35pm UTC](https://discuss.rubyonrails.org/t/plugin-dev-hook-into-actioncontroller-base-properly/43638 "2009-06-20T21:35:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [June 20, 2009, 9:35pm UTC](https://discuss.rubyonrails.org/t/plugin-dev-hook-into-actioncontroller-base-properly/43638/1 "2009-06-20T21:35:41Z")

</div>

Ok, in my example I just forgot to instantiate Test 😉

t = Test.new t.methods.include? 'load\_widget' # also results to true

But why I cannot call the method from withing the controller? :-/

---

<div class="post-metadata">

**Author:** ![Frederick\_Cheung](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/frederick_cheung/32/3901_2.png) [@Frederick\_Cheung](https://discuss.rubyonrails.org/u/Frederick_Cheung)\
**Post date:** [June 20, 2009, 11:04pm UTC](https://discuss.rubyonrails.org/t/plugin-dev-hook-into-actioncontroller-base-properly/43638/2 "2009-06-20T23:04:31Z")

</div>

> Ok, in my example I just forgot to instantiate Test 😉
> 
> t = Test.new t.methods.include? 'load\_widget' # also results to true
> 
> But why I cannot call the method from withing the controller? :-/

How are you calling things ? My guess is you're trying

class Test\< ActionController::Base &nbsp;&nbsp;some\_method\_from\_your\_plugin end

For this to work some\_method\_from\_your\_plugin needs to be a class method (since you are calling it on Test itself, not an instance of it) but it looks like you're only adding instance methods.

Fred
