title: How to properly post back information about a checkbox onclick event (RoR3)
body: <p>I am getting starting with RoR and this is my first attempt to use the new remote_function. I have sort of a project management app so you have projects (streams) and they have multiple tasks. Inside the stream show view, I want to list out the tasks with a checkbox next to them. If a user clicks on the checkbox, I want to post to /tasks/3 sending done=true so that the record will be probably updated. </p>
  
  <p>Here is code I came up with:</p>
  
  <p>&lt;%= check_box_tag "id", "id", task.done, 
      :onclick => remote_function(
        :update => "task", 
        :url => { :action => :update }, 
        :with => "'done=true'", 
        :complete => "alert('hi')"  ) %></p>
  
  <p>It does print the checkbox, and it does check it automatically depending on the status of task.done. But when I fire the onclick and watch the logs, I see the following entry:</p>
  
  <p>ActionController::RoutingError (No route matches "/streams/3"):</p>
  
  <p>"/streams/3" doesn't sound right, I would really be expecting to see something like /tasks/id instead.</p>
  
  <p>Can you help me figure out what I am doing wrong?</p>
  
  <p>Here is the full code for the view. </p>
  
  <pre><code>&lt;tr&gt;
    &lt;td class="task"&gt;
      &lt;span class="tasktitle"&gt;
  
  
  &lt;%= check_box_tag "id", "id", task.done, 
      :onclick =&gt; remote_function(
        :update =&gt; "task", 
        :url =&gt; { :action =&gt; :update }, 
        :with =&gt; "'done=true'", 
        :complete =&gt; "alert('hi')"  ) %&gt;
  
  
  
  &lt;span class="&lt;%= if (task.done) then "editable_field_complete" else "editable_field" end %&gt;" id="task_title_&lt;%= task.id %&gt;"&gt;
  &lt;%= best_in_place task, :title, :type =&gt; :input %&gt;
  &lt;/span&gt;
  &lt;/span&gt;
      &lt;span class="taskdelete"&gt;&lt;%= link_to "delete", task, :method =&gt; :delete, :class =&gt; "delete",
                                       :confirm =&gt; "You sure?",
                                       :title =&gt; task.title %&gt;&lt;/span&gt;
      &lt;span class="taskcreated"&gt;
        Created &lt;%= time_ago_in_words(task.created_at) %&gt; ago.
      &lt;/span&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>Thanks a lot guys</p>