title: Grails Update a List in GSP (View) and then submit with a button
body: <p>Imagine you have a table displaying a list of books (like the index does) and you want to make changes in a column called "Sold" (a checkbox for example). So once you finish "Checking" the books you have sold, you click a Button to save! How do you send back that list to the controller and update it?</p>
  
  <p>So, the code is something like this, in the controller:</p>
  
  <p>def aMethod(){
  ...
  [bookInstanceList: myBookList]
  }</p>
  
  <p>In the GSP:</p>
  
  <pre><code>    &lt;g:each in="${bookInstanceList}" status="i" var="bookInstance"&gt;
          &lt;tr class="${(i % 2) == 0 ? 'even' : 'odd'}"&gt;
  
              &lt;td&gt;&lt;g:link action="show" id="${bookInstance.id}"&gt;${fieldValue(bean: bookInstance, field: "author")}&lt;/g:link&gt;&lt;/td&gt;
              &lt;td&gt;&lt;g:checkBox name="sold" value="${bookInstance?.sold}" /&gt;&lt;/td&gt;
              &lt;td&gt;
          &lt;/tr&gt;
      &lt;/g:each&gt;
  </code></pre>
  
  <p>The idea is with the checkbox let the user change the "Sold" value from that book, and then make a submit with a Button. How can I save my new bookInstanceList?</p>
  
  <p>Thank you very much</p>