# ERB in layouts snippets or pages

**URL:** <https://www.ruby-forum.com/t/erb-in-layouts-snippets-or-pages/152340>\
**Category:** Radiant CMS\
**Created:** [November 2, 2008, 5:55pm UTC](https://www.ruby-forum.com/t/erb-in-layouts-snippets-or-pages/152340 "2008-11-02T17:55:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![steveluscher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3bc359/32.png) [@steveluscher](https://www.ruby-forum.com/u/steveluscher)\
**Post date:** [November 2, 2008, 5:55pm UTC](https://www.ruby-forum.com/t/erb-in-layouts-snippets-or-pages/152340/1 "2008-11-02T17:55:41Z")

</div>

What do you expert Radiant + Rails app developers do to display embedded  
ruby in your layouts, snippets, or pages?

I’m using the rails\_support extension and want to display some program  
variables in my layout, like the logged in user and his role.

Thanks!  
Steve

---

<div class="post-metadata">

**Author:** ![steveluscher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3bc359/32.png) [@steveluscher](https://www.ruby-forum.com/u/steveluscher)\
**Post date:** [November 2, 2008, 8:05pm UTC](https://www.ruby-forum.com/t/erb-in-layouts-snippets-or-pages/152340/2 "2008-11-02T20:05:45Z")

</div>

I don’t care for it, but there is the “backdoor” extension which allows  
ERb inside Radiant pages. Most often I find the seeming need for ERb  
represents one or more of these situations:

1. The user isn’t familiar enough existing tags or with manipulating the  
content structure.
2. A few new tags could fulfill the need very easily.
3. What is really wanted is a custom controller that has its own logic  
and views.

For example, you could wrap the “process\_page” method in SiteController  
so that it assigns the current\_user onto the page that is being  
rendered, then access that variable from some Radius tags.

Sean

---

<div class="post-metadata">

**Author:** ![steveluscher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3bc359/32.png) [@steveluscher](https://www.ruby-forum.com/u/steveluscher)\
**Post date:** [November 3, 2008, 11:09pm UTC](https://www.ruby-forum.com/t/erb-in-layouts-snippets-or-pages/152340/3 "2008-11-03T23:09:20Z")

</div>

I have no idea why I found the following post **after** I posted this  
reply.  
Looks like this should do the trick.  
[http://lists.radiantcms.org/pipermail/radiant/2008-August/010219.html](http://lists.radiantcms.org/pipermail/radiant/2008-August/010219.html)
