I have a rails application and I have all the jQuery scattered out in alot of different views and this is really ugly.I really want the jQuery in one place but when i take some of the jQuery code and move it to the application.js file the jQuery doesnt work or is maybe included last....I really dont know the issue. Can i have some help on the right way to do this ........
+1
A:
A few points:
- Ensure you include you 'application.js' file last in your layouts files
- If the functions require the DOM to load, use '$(document).ready'
Kevin Sylvestre
2010-09-19 14:45:16