View Full Version : Chrome CSS menu and Rails

12-30-2007, 09:30 PM
1) Script Title: Chrome CSS Drop Down Menu

2) Script URL (on DD): http://dynamicdrive.com/dynamicindex1/chrome/index.htm

3) Describe problem:

I have an existing website (http://rodneyandtina.com/rodney/nana) that uses the Chrome CSS menu successfully, but I am having difficulty integrating the menu with a new Rails app that I just added to the website. (The 4th menu, the Guestbook, is the new Rails app.) The problem occurs whenever there is a dropdown menu, which is reflected in this example:
<a href="#" rel="dropmenu1" >Menu1</a>

When I am in the Rails app, it simply appends the "#" to the end of the Rails path (in my case I get "http://rodneyandtina.com/railsnana/submit/new#") and it tries to go there. In order to workaround the problem somewhat, I've replaced the "#" with a static link, but this is not how I want the site to work, obviously.

Does anyone have any ideas on how to fix this behavior? This is only my second Rails app and I've never used the "rel" attribute of the "a" tag, so I'm a little bit stuck. Any help would be appreciated.


01-02-2008, 06:38 AM
I'm not sure I entirely understand what the question is. If you're wondering why the menu doesn't work on, say, this page (http://rodneyandtina.com/railsnana/submit/new), it's because with the "dummy" URL generated, the relative reference to chrome.js is no longer valid inside the page:

<script type="text/javascript" src="chromejs/chrome.js">

This can be fixed by changing the reference to it to absolute:

<script type="text/javascript" src="http://www.mysite.com/chromejs/chrome.js">

Obviously make sure the absolute URL to chrome.js is correct.