title: changing Rails check_box_tag to "checked" with Jquery
body: <p>The code for this is probably simple, but I'm not hot on Jquery yet and I couldn't find a solution online. </p>
  
  <p>In my view, users need to be able to select from a variety of plant images using a rails check_box_tag form submit. When a user clicks on a plant image, I want its accompanying check box to become selected. </p>
  
  <p>My view: </p>
  
  <pre><code>&lt;%= form_for @project.prelationships.build(:pfollowed_id =&gt; @project_id) do |f| %&gt;
    &lt;% Plant.all.each do |plant| %&gt;
      &lt;h&gt;
        &lt;%= image_tag plant.image_path %&gt;
        &lt;%= check_box_tag "prelationship[pfollower_id][]", plant.id %&gt;
      &lt;/h&gt;
    &lt;% end %&gt;
    &lt;%= hidden_field_tag :project_id, @project.id %&gt;
    &lt;%= f.submit "Pfollow" %&gt;
  &lt;% end %&gt;  
  </code></pre>
  
  <p>And in my application.js:</p>
  
  <pre><code>$(function () {
    $("h").click(function () {
      $(this).hide().parent().find(':submit').click();
    });
  });  
  </code></pre>
  
  <p>The problem with that javascript code right now is that it submits the form when you click on an image instead of simply checking off that image's checkbox. How do I modify that one line of code to return a checked checkbox on onclick? I've seen a lot of sample solutions online, but they have never dealt with rails' check_box_tag, which seems to require a unique answer. </p>