On Nov 29, 9:56 am, MDM <[email protected]> wrote: > I am testing a local copy of my website using Mongrel trying to > introduce a scriptaculous multi-level drop down menu. the menu is a > partial that is loaded into every layout I have many pages with their > individual layout file. When I jump from page to page(index to index) > all works OK. When I > jump from any "view/index" to "view/show" I lose the javascript and > the > drop down menu only works on the first level. Can anyone shed some > light > on why this happens and how I can solve it. In my layouts heads I have > the following:- > <head> > <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> > <title>Blogpictures: <%= controller.action_name %></title> > <%= stylesheet_link_tag 'style' %> > > <script src="javascripts/prototype.js" type="text/javascript"></ > script> > <script src="javascripts/scriptaculous.js" > type="text/javascript"></script> > <script type='text/javascript' src='javascripts/menu.js'></script> > </head> Those are relative paths, and almost certainly only work from the root of your site. It greatly helps when developing to use a tool like Firebug which will show you that the javascript files are 404ing.
And is there a reason you're not using javascript_include_tag? > In the source html both index and show has exactly the same head > (except title) > I am using the control.js protype.js etc that came with the > scriptaculous download also using the latest versions of Ruby, Rails, > Gems etc > Gems etc. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

