title: Rails Asset Pipeline is not loading my javascript file (why won't this code work
body: <p>This code works if I include it in the view itself and it works if I include it directly into the Application.js file, but it will not work if I include it in the assets/javascripts/mailers.js file... can anyone tell me what i am doing wrong, thanks.</p>
  
  <pre><code>function myFunction(val) {
  if (val.length == 10) {
  document.getElementById('search_button').focus();}};
  </code></pre>
  
  <p>Maybe I am calling it incorrectly? Here's the code in the view:</p>
  
  <pre><code>&lt;%= text_field_tag :search_mailer, nil, autofocus: true, onkeyup: "myFunction(this.value)" %&gt;
  </code></pre>
  
  <p>is there anything else i have to add into the mailers.js file I included above? Because that is all that is in that file. The only code in mailers.js file is:</p>
  
  <pre><code>function myFunction(val) {
  if (val.length == 10) {
  document.getElementById('search_button').focus();}};
  </code></pre>