# Rails app + Radiant

**URL:** <https://www.ruby-forum.com/t/rails-app-radiant/64345>\
**Category:** Radiant CMS\
**Created:** [June 24, 2006, 5:02pm UTC](https://www.ruby-forum.com/t/rails-app-radiant/64345 "2006-06-24T17:02:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tlianza](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ce7236/32.png) [@tlianza](https://www.ruby-forum.com/u/tlianza)\
**Post date:** [June 24, 2006, 5:02pm UTC](https://www.ruby-forum.com/t/rails-app-radiant/64345/1 "2006-06-24T17:02:59Z")

</div>

Hi Folks,

Finally getting around to having a play with Radiant - looks like  
it’s going to be fun. At last the CMS I’ve been waiting for: doesn’t  
do much; does it well; easily extended. 🙂 Not sure what it is  
about the Ruby community that people seem to “just get it” - more so  
than the Python crowd IMHO - but there you are.

Anyway.

I keep finding myself wanting a combination of a hand-rolled rails  
app with CMS. Here’s how imagine it working with Radiant:

- Add my models and controllers to a regular radiant app.

- Add routes to my models

- Have my controller actions do something like

The only part I’m not getting so far is how to get the dynamic bits  
into the page, e.g. the equivalent of (in regular Rails)

```
 @foo = ... / <%= @foo %>

```

I’m thinking either - use some kind of generic radius tag, or is  
there a way of dynamically adding tags that the page can use? As you  
can guess I’m completely new to the radius stuff.

Does that all make sense? How are other people doing this kind of thing?

Thanks

Tom

---

<div class="post-metadata">

**Author:** ![tlianza](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ce7236/32.png) [@tlianza](https://www.ruby-forum.com/u/tlianza)\
**Post date:** [June 24, 2006, 11:01pm UTC](https://www.ruby-forum.com/t/rails-app-radiant/64345/2 "2006-06-24T23:01:57Z")

</div>

Tom L. wrote:

> I keep finding myself wanting a combination of a hand-rolled rails  
> The only part I’m not getting so far is how to get the dynamic bits  
> into the page, e.g. the equivalent of (in regular Rails)
> 
> ```
> @foo = ... / <%= @foo %>
> 
> ```
> 
> I’m thinking either - use some kind of generic radius tag, or is  
> there a way of dynamically adding tags that the page can use? As you  
> can guess I’m completely new to the radius stuff.

Are you familiar with behaviors? If your actions aren’t too complicated  
you can rewrite them as behaviors. If you need to do something custom to  
the response you could override the #process method:

class MyBehavior \< Behavior::Base

```
 def process(request, response)
   ...
 end

```

end

Or, if you just want to add tags to a page you can do that using the  
define\_tags class method:

class MyBehavior \< Behavior::Base

```
 define_tags do
   tag "hello" do
     "hello world!"
   end
 end

```

end

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

---

<div class="post-metadata">

**Author:** ![tlianza](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ce7236/32.png) [@tlianza](https://www.ruby-forum.com/u/tlianza)\
**Post date:** [June 25, 2006, 10:34am UTC](https://www.ruby-forum.com/t/rails-app-radiant/64345/3 "2006-06-25T10:34:56Z")

</div>

> Are you familiar with behaviors? If your actions aren’t too  
> complicated  
> you can rewrite them as behaviors.

Thanks - I’ve just had a closer look at behaviors. For certain  
things I can see how rewriting actions as behaviors would work, but  
for some things, e.g. if I’ve got a few different form submissions  
going on, I can imagine this getting cumbersome.

Is there a way to achieve the flow I was asking about? i.e. the  
request goes to a regular action, which does its thing, then sets up  
data and redirects to a radiant page?

If this is something no one has looked at yet, I’ll just get stuck in  
to the source and figure out how to do it. I just wanted to check  
first that I’m not reinventing the wheel. I think the idea of a rails  
app with a “content managed” front end is very powerful. It certainly  
hits a sweet spot for my needs.

I’m now thinking along the lines of a generic ‘rails page’ behavior,  
that adds tags to the page based on data supplied from the  
controller. Makes sense? Is there an easy way to communicate the data  
from the controller to the behavior?

Thanks

Tom.

> …  
> Or, if you just want to add tags to a page you can do that using the  
> define\_tags class method:

Yep that would work.

---

<div class="post-metadata">

**Author:** ![tlianza](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ce7236/32.png) [@tlianza](https://www.ruby-forum.com/u/tlianza)\
**Post date:** [June 25, 2006, 8:22pm UTC](https://www.ruby-forum.com/t/rails-app-radiant/64345/4 "2006-06-25T20:22:00Z")

</div>

Why not use Rails? Its still there…

```
   Erik.

```

Tom L. schreef:

> Tom.

–  
Erik van Oosten

> **[Day to day stuff](http://day-to-day-stuff.blogspot.com/)**
>
> Experiences from a hard core JVM programmer. Likes to keep things simple.

---

<div class="post-metadata">

**Author:** ![tlianza](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ce7236/32.png) [@tlianza](https://www.ruby-forum.com/u/tlianza)\
**Post date:** [June 25, 2006, 9:19pm UTC](https://www.ruby-forum.com/t/rails-app-radiant/64345/5 "2006-06-25T21:19:03Z")

</div>

On 25 Jun 2006, at 19:19, Erik van Oosten wrote:

> Why not use Rails? Its still there…

From my previous post:

> I think the idea of a rails app with a “content managed” front end  
> is very powerful.

I often need to build sites that have some “web-app” functionality,  
intermingled with a lot of plain old content. It would be a _huge_  
benefit to me if the content authors have a nice web based CMS.  
They’re pretty excited about the idea too.

Tom

---

<div class="post-metadata">

**Author:** ![tlianza](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ce7236/32.png) [@tlianza](https://www.ruby-forum.com/u/tlianza)\
**Post date:** [June 26, 2006, 10:05am UTC](https://www.ruby-forum.com/t/rails-app-radiant/64345/6 "2006-06-26T10:05:31Z")

</div>

> > I often need to build sites that have some “web-app” functionality,  
> > intermingled with a lot of plain old content. It would be a _huge_  
> > benefit to me if the content authors have a nice web based CMS.  
> > They’re pretty excited about the idea too.
> 
> Radiant is Rails. Why not build a custom controller?

Well, yes - that was what I was intending to say in my first post. I  
was just after some advice as to the best way to handle the  
interaction between this controller and Radiant. It looks like no one  
on here has hit a need for this as yet, so I’ll have a dig around to  
figure out a sensible way of achieving this. Maybe I’ll add a page to  
the dev wiki with a how-to.

Tom.

---

<div class="post-metadata">

**Author:** ![tlianza](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ce7236/32.png) [@tlianza](https://www.ruby-forum.com/u/tlianza)\
**Post date:** [June 26, 2006, 12:31am UTC](https://www.ruby-forum.com/t/rails-app-radiant/64345/7 "2006-06-26T00:31:28Z")

</div>

Tom L. wrote:

> They’re pretty excited about the idea too.  
> Radiant is Rails. Why not build a custom controller?

–  
John L.
