# Plugin within an extension

**URL:** <https://www.ruby-forum.com/t/plugin-within-an-extension/113154>\
**Category:** Radiant CMS\
**Created:** [August 28, 2007, 7:46am UTC](https://www.ruby-forum.com/t/plugin-within-an-extension/113154 "2007-08-28T07:46:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dylan\_Nichols](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7ea924/32.png) [@Dylan\_Nichols](https://www.ruby-forum.com/u/Dylan_Nichols)\
**Post date:** [August 28, 2007, 7:46am UTC](https://www.ruby-forum.com/t/plugin-within-an-extension/113154/1 "2007-08-28T07:46:09Z")

</div>

Hi

I’ve built a simple events extension that has it’s own tags. I’m  
currently  
trying to incorporate the calendar\_helper plugin from Topfunky:

[http://topfunky.net/svn/plugins/calendar\_helper/](http://topfunky.net/svn/plugins/calendar_helper/)

I want to be able to generate a simple calendar from a Radius tag but I  
always get an undefined method error. I’ve used the page\_attachments  
extension as a basic guide for incorporating a plugin into a Radiant  
extension. I’ve placed the plugin in the lib/ folder of my extension and  
have put the content of the init.rb file into the activate method.

Is there a way I definitely can tell if the plugin has been loaded?

The other possible issue might be that the plugin is mixed into  
ActionView::Base which isn’t available from Radius tags:

ActionView::Base.send :include, CalendarHelper

Any suggestions would be greatly appreciated.

Cheers

Dylan

---

<div class="post-metadata">

**Author:** ![Dylan\_Nichols](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7ea924/32.png) [@Dylan\_Nichols](https://www.ruby-forum.com/u/Dylan_Nichols)\
**Post date:** [August 28, 2007, 2:51pm UTC](https://www.ruby-forum.com/t/plugin-within-an-extension/113154/2 "2007-08-28T14:51:13Z")

</div>

Dylan,

You’re on the right track with that. Radiant pages do not use  
ActionView. I would see if you can mix the CalendarHelper into your tag  
module instead of ActionView::Base and use it from inside a tag  
definition.

Sean

---

<div class="post-metadata">

**Author:** ![Dylan\_Nichols](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7ea924/32.png) [@Dylan\_Nichols](https://www.ruby-forum.com/u/Dylan_Nichols)\
**Post date:** [August 29, 2007, 3:13am UTC](https://www.ruby-forum.com/t/plugin-within-an-extension/113154/3 "2007-08-29T03:13:10Z")

</div>

Thanks Sean,

I stuffed around for a bit and discovered that the files within the lib/  
folder of the plugin had to be within the lib/ folder of my extension.

I then loaded it using the following in my activate method:

Page.send :include, CalendarHelper

Dylan
