# Render :template (for single page website)

**URL:** <https://www.ruby-forum.com/t/render-template-for-single-page-website/89025>\
**Category:** Rails\
**Created:** [March 16, 2007, 3:10pm UTC](https://www.ruby-forum.com/t/render-template-for-single-page-website/89025 "2007-03-16T15:10:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![keybern](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/8edcca/32.png) [@keybern](https://www.ruby-forum.com/u/keybern)\
**Post date:** [March 16, 2007, 3:10pm UTC](https://www.ruby-forum.com/t/render-template-for-single-page-website/89025/1 "2007-03-16T15:10:48Z")

</div>

hi,  
I’m developping a (complex) website that consists of only a single page.  
Therefor I like all my controller methods to render the same template.  
At the moment I have a main.rhtml and a main method. I added some other  
methods with at the end of there body the following code:

render :template =\> “main”

but when I call one of those methods the template seems to be rendered  
at a different location (is it?) because all the links to the css and  
images are broken, and I can’t call any actiona anymore…

Some way to fix this?

(using render :action instead of render :template doesn’t do the trick)

---

<div class="post-metadata">

**Author:** ![keybern](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/8edcca/32.png) [@keybern](https://www.ruby-forum.com/u/keybern)\
**Post date:** [March 16, 2007, 3:58pm UTC](https://www.ruby-forum.com/t/render-template-for-single-page-website/89025/2 "2007-03-16T15:58:47Z")

</div>

I must correct myself:

my controller is “main”, the method is “index”

now, when I surf to [http://localhost:3000/main](http://localhost:3000/main) everything’s fine, when I  
surf to [http://localhost:3000/main/index](http://localhost:3000/main/index) all my images and css-link are  
broken :-/  
Now why is that?
