title: Rails check_box_tag how to pass value when checked ajaxily
body: <p>On my index page for my Task model, I want to show a checkbox for every row that corresponds to the boolean field "complete" in my Task database table.</p>
  
  <p>Currently my code gets into the method "Complete", but it does not contain the value of the checkbox that the user just did (i.e. if they just checked the box, it does not pass true to my "Complete" method).</p>
  
  <p>How can i pass the value that the user just performed - either checked or un checked?</p>
  
  <p>/views/tasks/index.html.erb</p>
  
  <pre><code>&lt;% @tasks.each_with_index do |task, i| %&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;%= check_box_tag 'Complete', task.complete, task.complete, :data =&gt; {:remote =&gt; true, :url =&gt; url_for( :action =&gt; 'complete', :id =&gt; task.id, :complete =&gt; task.complete ), :method =&gt; :put}, :class =&gt; 'input-large' %&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>/controllers/tasks_controller#complete</p>
  
  <pre><code># PUT /complete/1
    def complete
      @task = Task.find(params[:id])
      p "inside complete"
      p "complete = #{params[:complete]}"
      @task.complete = 
  
        if @task.update_attributes(params[:task])
          p "inside update"
          render :text =&gt; "success" 
        else
          p "inside error"
        end
  
    end
  </code></pre>