title: Rails -- ERB is ignoring JS / jQuery
body: <p>I have the following code below in my view:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;    
    $(document).ready(function(){    
      $("#button").click(function(event){
        if(false) { //even with if (false), this code is still being executed!
          &lt;% if obj %&gt;
            &lt;% my_method(obj) %&gt;
          &lt;% end %&gt;
          $("#button").attr("href","/" + obj.my_path);
        }
      });        
    });
  &lt;/script&gt;
  </code></pre>
  
  <p>As you can see by the comment, the condition for the JavaScript if statement is false, so the block should never be executed.  Yet for some reason it is like my JS does not exist and the ERB block is being called.  Why is this happening?  JS seems to work fine on other pages on the site.</p>
  
  <p>If you need more info about this to help solve the problem ask away and I will try to provide as much information as I can.</p>