title: Javascript: How to check if check_box in rails is checked or not?
body: <p>I have a check_box with id "current" in one of my views on my Rail application and I also have a text_field with id "end"  in the same view. When the checkbox is clicked, I want the display of the text_field to be none. </p>
  
  <p>I had a jQuery method which was not working:</p>
  
  <pre><code>$(document).ready(function() {
     if ($('#current').checked) {
        $("#end").show();
     }
     else {
        $("#end").hide();
     }
  }
  );
  </code></pre>
  
  <p>Anyway I can check the Boolean value of the check_box using Javascript? </p>