# Calling radiant layouts, from external rails app

**URL:** <https://www.ruby-forum.com/t/calling-radiant-layouts-from-external-rails-app/146721>\
**Category:** Radiant CMS\
**Created:** [August 24, 2008, 5:49pm UTC](https://www.ruby-forum.com/t/calling-radiant-layouts-from-external-rails-app/146721 "2008-08-24T17:49:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeanluca](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/74df32/32.png) [@jeanluca](https://www.ruby-forum.com/u/jeanluca)\
**Post date:** [August 24, 2008, 5:49pm UTC](https://www.ruby-forum.com/t/calling-radiant-layouts-from-external-rails-app/146721/1 "2008-08-24T17:49:44Z")

</div>

Many posts are already appeared about integrating radiant and rails  
distinct apps,  
anyway here my needs are simpler: run them in parallel and call the  
radiant layout ( snippets, layouts and pages ) from the other rails app  
embedding the radiant views components. What is the better way to go ?

For what I’ve understood about Creating\_an\_extension\_VI tutorial, the  
share\_layouts extension is installed inside “Radiant app” and permits to  
call radiant\_layout ‘Normal’ within the new extention controller, which  
means to me, “not outside radiant”.

Is that possible calling the radiant\_layout from an external rails app?  
Are there  
other plugins to have a look ?

I’ve also thought to dump the layout on the file system via  
“file\_system\_extension” that produce a ~/radiant\_app/design/layouts,  
pages and snippets dir tree. Then point the rails app to the radiant  
design dumped filesystem to load.

Untill now I “get the job done” by hacking css, erb and partials  
manually into the rails app, but I’m looking for a cleaner, manageable  
and dry way.

Do you please know a better way to go ?  
thz in advance  
lgs

---

<div class="post-metadata">

**Author:** ![jeanluca](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/74df32/32.png) [@jeanluca](https://www.ruby-forum.com/u/jeanluca)\
**Post date:** [August 24, 2008, 6:54pm UTC](https://www.ruby-forum.com/t/calling-radiant-layouts-from-external-rails-app/146721/2 "2008-08-24T18:54:15Z")

</div>

You could conceivably pull the Radiant layout into your other app, but  
it’s not going to get you much without the parsing framework of  
Radiant. The Radius tags embedded in the layout are very specific to  
Radiant’s content model and you would spend a lot of time parsing or  
modifying them to work in your Rails app. The point of share\_layouts is  
to bridge the gap between custom Rails functionality and Radiant’s  
parsing framework; the tradeoff is that your Rails stuff should be  
created as an extension to Radiant. I believe you’ll find that you  
won’t lose much if you choose to do that. Your other option is to  
maintain separate layouts for your Rails app and for your Radiant  
installation.

Sean

---

<div class="post-metadata">

**Author:** ![jeanluca](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/74df32/32.png) [@jeanluca](https://www.ruby-forum.com/u/jeanluca)\
**Post date:** [August 24, 2008, 9:37pm UTC](https://www.ruby-forum.com/t/calling-radiant-layouts-from-external-rails-app/146721/3 "2008-08-24T21:37:47Z")

</div>

What about the past try to pluginize radiant? I saw some old posts about  
mini\_radiant plugin, RadiantOnRails and others, but they all seems to be  
died actually. Should be great to get a light radiant plugin or engine  
for classic rails, to add on complex preexisting backend rails  
application. I rally would like to be able to produce new layouts,  
sneppets and pages to that complex backend the same way I’m actually  
doing with Radiant (hoping that should speed up refactoring and  
maintenance).

The share\_layouts tradeoff is now clear to me and seems very powerful  
and promising for new dinamic extension which is projected from scratch,  
but in my case I really would need to integrate an OpenID server to the  
CMS (masquerade).

I’ve a successful try with Comatose, but Radiant is clean, easy and  
powerful and two things really turn me on about that: extensions and  
layout management.

I also tryed to port masquerade into radiant extension, but until now,  
without any success.

Do you think could it be of some interest to anyone porting an identity  
server to a Radiant extension  
([http://github.com/dbloete/masquerade/tree/master](http://github.com/dbloete/masquerade/tree/master))?

In case, I’ll share my steps and see if someone get some ideas to pass  
on my first failures.

thz  
lgs
