I’m having a problem accessing my javascripts from certain pages in my local Ruby on Rails site.
I have jquery javascript files located in /public/javascripts
These scripts render an instagram feed that is embed in the page
When I go to a page like http://localhost:3000/users, the script loads fine; however, if I go to a particular user, http://localhost:3000/users/1, the script does not load.
I feel like I am missing some kind of fundamental routing technique.
The scripts are located in my views/layouts/application.html.erb
They are referenced like so:
<script type="text/javascript" src="javascripts/jquery-1.6.1.min.js"></script>
What am I missing? Thanks in advance for the help.
Use the absolute path of jquery.
Or you could include the below line in the
application.jsif your rails is not old enough.