title: JavaScript won't work on my rails app
body: <p>I have a problem with running js/jquery in my rails app.
  I have Ruby 1.9.3 and Rails 3.2.3 installed.</p>
  
  <p>I have two js files in /app/assets/javascripts:</p>
  
  <pre><code>application.js
  main.js
  </code></pre>
  
  <p>I created this main.js. In it there is this code</p>
  
  <pre><code>$(document).ready(function() {
      alert('Hello world!');
  });
  </code></pre>
  
  <p>my application.js has the following:</p>
  
  <pre><code>//= require jquery
  //= require jquery_ujs
  //= require_tree .
  //= require main.js
  </code></pre>
  
  <p>When I open my app, no alert message pops up!</p>
  
  <p>Opening the source code, i see all the js files in place:</p>
  
  <pre><code>&lt;script src="/assets/jquery.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/jquery_ujs.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/main.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="/assets/application.js?body=1" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>What I am doing wrong???</p>