title: Why is rails not rendering the .js.erb file?
body: <p>I have a rails application where I am trying to have jQuery render WITH an HTML file.  The point of this is that the jQuery is specific to the page so I don't want it loading for every page by putting it in the header.  Here's what I have done to the files</p>
  
  <p><strong>messages_controller.rb</strong></p>
  
  <pre><code> # GET /messages/new
   def new
      @message = Message.new
      @users = User.where('id != ' + current_user.id.to_s)
      #if @message.save
         #MessageMailer.new_message(@message).deliver
  
      respond_to do |format|
         format.html # new.html.erb
         format.js
      end
      #end
   end
  </code></pre>
  
  <p><strong>/messages/new.html.erb</strong></p>
  
  <pre><code>&lt;div class="row"&gt;
      &lt;div class="large-12 columns"&gt;
          &lt;div class="panel"&gt;
              &lt;h1&gt;New message&lt;/h1&gt;
              &lt;%= render 'form' %&gt;
  
              &lt;%= link_to 'Back', messages_path, :class =&gt; "button small" %&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>/messages/new.js.erb</strong></p>
  
  <pre><code>$("h1").html('hello'); //for testing that it works
  </code></pre>
  
  <p>Is there something that I have to add to another file?  Is there a request I have to make so it loads both the HTML and .js?</p>