title: Using a check_box to change the boolean attribute on a model (rails)
body: <p>I'm making a grocery list application in which I'd like to let users check off the items that they've placed in the cart. I'd like to do this by toggling the attribute "found" from false to true (within my "item" model). </p>
  
  <p>Here's the code I have for this:</p>
  
  <pre><code>&lt;% for item in @items %&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;%= check_box, item, :found, {}, true, false %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= item.quantity %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= item.name %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= item.category %&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;br /&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>I then have an "update" link at the bottom of the page. A list has many items, when I ask to update a list, I'm assuming that I'm also updating the attributes of the items within that list. </p>
  
  <pre><code>&lt;%= link_to "Update", @list, :method =&gt; :put %&gt; |
  </code></pre>
  
  <p>Here's the update action in my list controller:</p>
  
  <pre><code>  def update 
      @list = List.find(params[:id])
      if @list.update_attributes(params[:list])
        flash[:notice] = "Successfully updated list"
        redirect_to @list 
      else 
        render :action =&gt; 'edit'
      end 
    end
  </code></pre>
  
  <p>I believe I'm following the documentation for check_box correctly. Nevertheless, somehow the "found" boolean stays false after I update. Does anyone know how to implement this correctly? I'd like to not use AJAX for the time being. Thanks!  </p>