title: ActionController::RoutingError: No route matches -> while using checkbox + ajax
body: <p>I am building a simple task management app and a weird problem happens when I try to handle checkbox to indicate a task is done.</p>
  
  <p>Here is code I came up with:</p>
  
  <pre><code>&lt;%= check_box_tag "id", "id", task.done, 
      :onclick =&gt; remote_function(
        :update =&gt; "task", 
        :url =&gt; { :action =&gt; :update, :controller =&gt; :tasks, :id =&gt; task.id }, 
        :with =&gt; "'task[done]=true'", 
        :complete =&gt; "alert('hi')"  ) %&gt;
  </code></pre>
  
  <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><em>Started POST "/tasks/20" for 127.0.0.1 at 2011-04-25 23:15:44 -0300
  ActionController::RoutingError (No route matches "/tasks/20"):</em></p>
  
  <p>Looking at my config/routes.rb file, I have: </p>
  
  <pre><code> resources :tasks
  </code></pre>
  
  <p>Can you help me figure out what I am doing wrong? Why is the route not found?</p>
  
  <p>Here is the full code for the <strong>_task.html.erb</strong> 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, :controller =&gt; :tasks, :id =&gt; task.id }, 
        :with =&gt; "task[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>