title: Update a boolean cell in my table
body: <p>I have a form and I want to update the <code>show_msg</code> parameter (it's a boolean parameter) while the user press the submit button. if the user checked the box and press submit, I want to set it TRUE. otherwise: FALSE.</p>
  
  <p>so I have the main html that has a popup window. in this popup window I wrote my form. (<strong>what should I have the write in 'action'?</strong> I just have to close this popup window):</p>
  
  <pre><code>&lt;form name="input" action="#" method="post"&gt;
     &lt;input type="checkbox" id="mycheckbox"&gt;Don't show me again&lt;br&gt;
     &lt;input type="submit" id="Submit"&gt;
  &lt;/form&gt; 
  </code></pre>
  
  <p>this is my javascript:</p>
  
  <pre><code>$("#submit").click(function() {
     $.ajax({
       ## the url is the controller
       url: '/welcome',
       type: 'PUT',
       data: {show_msg: $("#mycheckbox").is(":checked")}
     });
  });
  </code></pre>
  
  <p>and this is my controller:</p>
  
  <pre><code>class WelcomeController &lt; ApplicationController
  
  def update
      @user = User.find(params[:id])
  
      respond_to do |format|
          if @user.update_attributes(params[:show_msg])
              format.html { redirect_to @user, notice: 'You will never see this message again.' }
              format.json { head :no_content }
          end
      end
  end
  </code></pre>
  
  <p>any help appreciated!</p>