# Multiple "view" directories to achieve rails "themes"

**URL:** <https://www.ruby-forum.com/t/multiple-view-directories-to-achieve-rails-themes/187505>\
**Category:** Rails\
**Created:** [April 24, 2010, 7:08am UTC](https://www.ruby-forum.com/t/multiple-view-directories-to-achieve-rails-themes/187505 "2010-04-24T07:08:22Z")\
**Posts on this page:** 3\
**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:** [April 24, 2010, 7:08am UTC](https://www.ruby-forum.com/t/multiple-view-directories-to-achieve-rails-themes/187505/1 "2010-04-24T07:08:22Z")

</div>

Hi

I’d like to have various “themes” for my site that cannot be achieved  
by changing the CSS or anything else.

So my directory structure might look like this:

app  
\ views  
-  
\ users  
\ blogs  
-  
\ THEME2  
-  
\ users  
\ blogs

(where the two “users” directories contain all the erb or haml)

With my controllers - is there a way to conditionally insert the  
“theme2” directory into the view path before the erb/haml gets  
searched for and rendered ???

Would be nice to no have to explicitly call render

I’m using rails3

Any ideas?

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:** [April 24, 2010, 12:54pm UTC](https://www.ruby-forum.com/t/multiple-view-directories-to-achieve-rails-themes/187505/2 "2010-04-24T12:54:50Z")

</div>

Maybe I just need to ask it this way:

At the end of every action the “render” function is called  
automatically with no options (unless the programmer explicitly calls  
it).

Any clues as to how I would override that method to modify the folder  
path for the “view” files?

Any tips would be heaps appreciated

thanks guys

---

<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:** [April 24, 2010, 3:31pm UTC](https://www.ruby-forum.com/t/multiple-view-directories-to-achieve-rails-themes/187505/3 "2010-04-24T15:31:28Z")

</div>

removed\_email\_address@domain.invalid wrote:

> Maybe I just need to ask it this way:
> 
> At the end of every action the “render” function is called  
> automatically with no options (unless the programmer explicitly calls  
> it).
> 
> Any clues as to how I would override that method to modify the folder  
> path for the “view” files?
> 
> Any tips would be heaps appreciated

You might want to look at [GitHub - coderberry/themes: Commonly Used Themes](http://github.com/cavneb/themes) .

> thanks guys

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
