Why does $(window).load() work but not $(document).ready()?
I'm working with a rails 3 app, and I want to use a sortable list. I'm working with the method shown here . My app uses JQuery, and there's a js file included in my app's layout that calls $(document).ready() to set up some visual stuff. That seems to be working fine. However, when I attempt to call $(document).ready() in my view template via content_for :javascript to set up the sortable list, that code never fires. I do have the requisite yield :javascript call in my layout file, and if I load the page and look at the source everything looks fine. The code never runs, though – i.e. this