title: How to get an action from a checkbox click in ruby
body: <p>I want to be able to give the user a 'show all' option on a page with kaminari pagination</p>
  
  <p>If there are more than 20 rows, the bottom of the page shows</p>
  
  <blockquote>
    <p>« First ‹ Prev 1 2   ()       Show all documents</p>
  </blockquote>
  
  <p>where is () a checkbox</p>
  
  <p>I want to code the page so that I can hide the kaminari pagination if the checkbox is clicked. </p>
  
  <p>I am stuck right now because I can't seem to get the onchange or onclick to work. </p>
  
  <pre><code>    &lt;td&gt; &lt;%= paginate @documents %&gt;&lt;/td&gt;
       &lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
       &lt;td&gt;Show all documents &lt;%= check_box_tag("Show all on one page", "show_all", true,
                                                :onchange =&gt;   "javascript_tag alert('All is good')"
                                                ) %&gt;
       &lt;/td&gt;
     &lt;/tr&gt;
  </code></pre>
  
  <p>With the code above, the js popup appears when the page is loaded but does not appear when the checkbox is clicked/changed  </p>
  
  <p>My goal is to be able to execute code when a checkbox is clicked. </p>