How do you set up jQuery to work with rails. I specifically want to use the accordion feature. I have used this before with PHP but i cannot work out where everything needs to go in a rails application. I have imported jQuery into the javascript folder and included it in the application. My HTML is laid out correctly, but i don't understand where the following should go:
<script>
$(document).ready(function() {
$("#accordion").accordion();
});
</script>
I have also tried installing jRails and using the scriptaculous Accordion, but neither of them worked either, so I think I am missing some vital link between javascript and rails.
I have looked all over for some explicit instructions on how to set it up, if anyone has a link or can walk me through it it would be appreciated.
After checking firebug I can see I am getting the following error:
$("#accordion").accordion is not a function
I call jQuery before I call application.js