title: Rails, Giving a remote partial local variables
body: <p>So I have this partial that has 2 variables: <code>coursetitle</code> and <code>routenumber</code>. I tried setting these variables from the view but I can't access these from the partial unless I make them global. I am looking for a way to pass on these variables from either the view or the controller but I am a bit lost as to why I can't set them from the view. </p>
  
  <pre><code>&lt;div&gt;
  &lt;h2&gt; Correct!&lt;/h2&gt;       
  
        &lt;%= link_to "Next", "/courses/#{coursetitle}_q#{routenumber}",class:"btn btn-warning" %&gt;
        &lt;%= render 'layouts/coursefooter' %&gt;
  
  
        &lt;!-- fix for bootstrap navbar render bug --&gt;
        &lt;script&gt; 
        $( ".puller" ).addClass( "pull-left" );
        &lt;/script&gt;
  </code></pre>
  
  <p></p>
  
  <p>I call this partial by :remote like this: </p>
  
  <pre><code>&lt;%= link_to "Correct", correct_answer_courses_path,:remote =&gt; true,:class=&gt;"btn btn-warning"  %&gt;
  </code></pre>
  
  <p>And my correct_answer.js looks like this:</p>
  
  <pre><code>$("#correct_answer").html("&lt;%= j render partial: "beginnercourse/correct" %&gt;");
  </code></pre>