multiple document ready(s) and noconflict

multiple document ready(s) and noconflict

I'm having trouble using jquery with Rails. I know there are a few plug-in solutions but I am more designer than developer and the rest of my team isn't excited about changing to a new plug-in midstream.

I want to be able to write my jquery and be able to have the least impact on existing code. This means that I have to use the noconflict method. Originally I was trying to use Rails to write all my jQuery into one document ready statement but I recently found out you can have more than one. doh!

Now my problem is that my jQuery variable isn't always ready byt the time my document ready function runs. For example:

    var $j = {};
    $j = jQuery.noConflict(true);
    $j(document).ready(function(){
        // some code
    });

    // another js file
    $j(document).ready(function(){
        // more code
    });

The document ready statement int he second file never seems to work. What am I missing?