Want to avoid feeling like a chump and spending countless hours troubleshooting a crazily-stupid-simple problem?
When you enter a .js in your javascripts directory and include it using a javascript_include_tag, take the <script> tags off the front and back.
You probably knew that already. Why didn't you tell me sooner?








Why, yes! Yes I do!
Oh, okay.
I didn't knowit already! You have to believe me!
remove
Here's another tip:
the javascript_include_tag also allows you to include multiple scripts at once, separated by commas.
I've seen people use it over and over like this:
javascript_include_tag("script1") javascript_include_tag("script2") javascript_include_tag("script3")
Instead, you can just do this:
javascript_include_tag("script1", "script2", "script3")
you can also include :defaults which can be configured (but by default is Prototype/Scriptaculous) and you can include :all which will nab everything in the public/javascripts folder.
remove