Forum: Ruby on Rails render :template (for single page website)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
53c769fbf51f318a310e0725b6b8052c?d=identicon&s=25 Key Bern (keybern)
on 2007-03-16 15:10
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)
53c769fbf51f318a310e0725b6b8052c?d=identicon&s=25 Key Bern (keybern)
on 2007-03-16 15:58
I must correct myself:

my controller is "main", the method is "index"

now, when I surf to http://localhost:3000/main everything's fine, when I
surf to http://localhost:3000/main/index all my images and css-link are
broken :-/
Now why is that?
This topic is locked and can not be replied to.