# Possible to apply layouts on pages in public folder

**URL:** <https://www.ruby-forum.com/t/possible-to-apply-layouts-on-pages-in-public-folder/130933>\
**Category:** Rails\
**Created:** [March 4, 2008, 4:22pm UTC](https://www.ruby-forum.com/t/possible-to-apply-layouts-on-pages-in-public-folder/130933 "2008-03-04T16:22:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fred\_So](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ea5d25/32.png) [@Fred\_So](https://www.ruby-forum.com/u/Fred_So)\
**Post date:** [March 4, 2008, 4:22pm UTC](https://www.ruby-forum.com/t/possible-to-apply-layouts-on-pages-in-public-folder/130933/1 "2008-03-04T16:22:30Z")

</div>

Is it possible to apply a layout to rhtml files in the public folder?  
These files are essentially static.

I am trying to avoid having to create blank actions/methods for each  
html  
files.

---

<div class="post-metadata">

**Author:** ![Fred\_So](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ea5d25/32.png) [@Fred\_So](https://www.ruby-forum.com/u/Fred_So)\
**Post date:** [March 4, 2008, 4:42pm UTC](https://www.ruby-forum.com/t/possible-to-apply-layouts-on-pages-in-public-folder/130933/2 "2008-03-04T16:42:38Z")

</div>

render :file =\> “path/file”, :layout =\> true  
should do that

it would expect an erb file, but should work with pure html, too  
if not, then  
render :inline =\> …  
or  
render :text =\>  
would do it, but you would have to load the file and hand it’s content  
to the renderer

anyway, you would not have to create any actions or methods for that,  
you could just put the content into a partial

---

<div class="post-metadata">

**Author:** ![Fred\_So](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ea5d25/32.png) [@Fred\_So](https://www.ruby-forum.com/u/Fred_So)\
**Post date:** [March 5, 2008, 7:53am UTC](https://www.ruby-forum.com/t/possible-to-apply-layouts-on-pages-in-public-folder/130933/3 "2008-03-05T07:53:23Z")

</div>

Sorry about my inexperience - where do you suggest to put the line

render :file =\> “path/file”, :layout =\> true

---

<div class="post-metadata">

**Author:** ![Fred\_So](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ea5d25/32.png) [@Fred\_So](https://www.ruby-forum.com/u/Fred_So)\
**Post date:** [March 5, 2008, 9:01am UTC](https://www.ruby-forum.com/t/possible-to-apply-layouts-on-pages-in-public-folder/130933/4 "2008-03-05T09:01:07Z")

</div>

When I try to add the line

\<% render :file =\> “my\_path/my\_file.erb”, :layout =\> true %\>

at the top of my page - called “index.rhtml”

I get a routing error:

no route found to match “/index.rhtml” with {:method=\>:get}
