# Trying to treat Radiant like Rails

**URL:** <https://www.ruby-forum.com/t/trying-to-treat-radiant-like-rails/109420>\
**Category:** Radiant CMS\
**Created:** [July 14, 2007, 5:37pm UTC](https://www.ruby-forum.com/t/trying-to-treat-radiant-like-rails/109420 "2007-07-14T17:37:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 14, 2007, 5:37pm UTC](https://www.ruby-forum.com/t/trying-to-treat-radiant-like-rails/109420/1 "2007-07-14T17:37:11Z")

</div>

Radius provides a way to turn an object’s methods into tags:

[http://radius.rubyforge.org/files/QUICKSTART.html](http://radius.rubyforge.org/files/QUICKSTART.html)  
(near “Exposing Objects to Templates”)

This seems like it would be a useful way to get at the properties of  
Active Record objects from with Radiant (for writers of extensions,  
for example.)

However, the Radiant::Taggable module does not seem to pull in the  
necessary define\_tag() method necessary (of Radiant::Context) to do  
this.

Any suggestions for the Radiant way of making tags out of the  
properties of an object? I think i will be able to do it one-by-one,  
method by method, making a tag for each desired method. This is  
probably a bit beyond the scope of Radiant, but I’d thought i’d ask.

Along these lines, has this been done before: When writing  
models/views/controllers for an extension, is it possible to have a  
controller’s action (result) embed itself within the context of a  
radiant page? This would be the best of the rails _and_ radiant  
world!

I think the problem is I’m trying to use Radiant like a rails app.  
I’m trying to squeeze out that last 20%, since i love the first 80%.

Thanks

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 16, 2007, 10:07pm UTC](https://www.ruby-forum.com/t/trying-to-treat-radiant-like-rails/109420/2 "2007-07-16T22:07:06Z")

</div>

Mark Meves wrote:

> necessary define\_tag() method necessary (of Radiant::Context) to do  
> this.

You could use:

PageContext.class\_eval do  
define\_tag …  
end

Kind of a hack, but it would work.

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)
