Plugin within an extension


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

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.




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


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


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs