I have a rails application I am developing and there’s basically a
minor thing I would like to do that makes my development a little bit
of a pain.
I’m currently doing my local development using ruby’s webrick. I’m
also relative new to web development, so pardon my ignorance, too.
Basically, my website has a menu system using CSS that is common to
all of its web pages, including the rails web pages. This is to allow
the user to jump from the rails “store” to any other part of the web-
site (home page, etc). Those external web pages are not inside the
Thus, all my pages have the menu embedded in them, like:
<li class="top p1"><a href="index.html" class="top">Home</a></
In rails, the views/layouts/*.rhtml pages have a similar menu embedded
What’s bothering me is that within rails those links cannot be
relative as they are in the rest of my website, as any relative path
takes me to localhost:3000/relative_path, instead of the root of my
website. The problem seems to happen both during development and
I was wondering if there was an easy way to keep the paths relative,
but make sure the web server knows they are relative to a certain root
directory and not the rails’ public root directory.