Radiant and plugins

by Jim Gay

Radiant loads plugins just like any typical Rails application.

If you want to load custom routes, they are loaded from the plugin’s config/routes.rb file. Custom controllers and views? They are pulled from the plugin’s app directory.

So if you need to pull in an application plugin which does all this for you, you’re free to do so. There’s still plenty of work to be done with the core to make things simpler, but loading plugins like a regular Rails application is no problem. You’re still constrained by the code in ApplicationController if you inherit from that, but you don’t necessarily need to inherit from ApplicationController for any particular reason.

But Radiant’s extensions can also bring plugins with them. So, for example, if you want to work with the AdminUI in Radiant but want to pull in a plugin’s code there, you can work with vendor/extensions/your_extension/vendor/plugins/your_plugin. Yes, that works too, even the config/routes.rb

In both your project’s vendor/plugins and your extension’s vendor/plugins you can load the interface you need with controllers, views, models, metal, etc.

If you’re working with Radiant, you might be able to use some development direction or even a simple consultation to give your plans a head-check. Give me a call at 571-403-0338

Comments

Eric Davis said on Wednesday, April 14, 2010:

I’ve been wondering a long time, why doesn’t Radiant use Engines?

Coming from Redmine where all of the plugins are Engines, we get Model/View/Controller automatically along with routes.rb, i18n, and plugin plugins for free. Given that Rails 3 is heading the Engines way, is Radiant going to have to play catch up with it’s extension system? (wycats told me Engines will be supported in Rails 3 just like 2.3.5 and the app “mounting” will be added later.)

I’m not trying to be critical, just trying to understand what the value of the custom extension system is. I’d be happy to continue this discussion on Twitter if it’s easier (@edavis10).

Eric

Jim Gay said on Wednesday, April 14, 2010:

Eric, I wasn’t in volved in the building of the Extension system, but my basic answer is that it was built because Engines weren’t exactly what was needed or the solution to the problem didn’t exist yet. Extensions will become more like plugins and most likely loaded from vendor/plugins in the future.

Spree has an extension system that was pulled from Radiant and we’re talking about ways to integrate the 2. Hopefully the impact will be wider than just those projects.

lottadot said on Thursday, February 17, 2011:

Was there ever any progress with this? I looks like your post was April 2010, in a few months it'll be April 2011. Is this the proper place for such a question or is one of the two Radiant google groups more appropriate?

Thanks!
#radiantnewbie

shanison said on Wednesday, March 09, 2011:

Hi Jim, pardon me that i just started to explore Radiant. Why Radiant use extension but not use plugin? Default Ruby on Rails project doesn't have any extension folder in vendor directory. So why Radiant needs to develop its own way and called it extension? Is there any difference between these two? The reason that I can think of is that Radiant needs to load its custom configuration or environment before it loads its extension.

Post a comment


(required, but not displayed)

(optional)



(required)

1999 - 2012 © Saturn Flyer LLC 2127 S. Oxford St. Arlington, VA 22204

Call Jim Gay at 571 403 0338