Java Script in Rails 3.1 works only in certain parts. Any idea why?
- by Sergio Nekora
This might seem a bit weird, but since I am new in RoR and cannot find any similar questions I thought you might know. The situation is that JavaScript does not work throughout my whole site.
For instance. For the sake of checking, I place a link with an alert function in the footer. It did not work at the beginning, it felt like the JS was disabled(but it wasn't). But eventually it worked.
Now it works in most the pages but it does not work in one that there is also an 'autocomplete' field. Of course, this autocomplete field does not work either.
That could lead you to think that there is something wrong with the autocomplete code. However this same code is working in the sidebar.
Any ideas why?
Could it have anything to do with the fact that one day my assets folder appeared empty? After installing the gmaps4rails gem I realized that all my Js and CSS files were gone from my assests folder. Ok, it might have happened long before and I just realized at that point. I don't really know.
Here in the root you can see that the 'Hola sip' click at the button works. here it works
However, here same link does not trigger the alert function.
here it doesn't