title: How to insert Javascript code in a Ruby injection
body: <p>I have 2 text fields. One is for the input of a member's id, and the other is the output of the member's name.</p>
  
  <p>When I type a member's id in the first field and the action <code>onblur</code> is triggered, I would like to show the member's name in the other field.</p>
  
  <p>This is my Javascript function:</p>
  
  <pre><code>function show_name(){
            id = document.getElementById('id_member').value;
            field_name = document.getElementById("name_member");
  
            field_name.value = "&lt;%= Member.find().nom %&gt;";
        }
  </code></pre>
  
  <p>In the method <code>Member.find()</code> I would like to send the value of the variable <code>id</code> that I've declared at the beginning. Example:</p>
  
  <pre><code>field_name.value = "&lt;%= Member.find(*Javascript "ID" variable value*).nom %&gt;";
  </code></pre>
  
  <p>How can I insert that value into my Ruby injection?</p>
  
  <p>Thanks.</p>