RESTful checkbox to complete task

Here's where I am right now:

View: <div id="tasks">

<% for task in @tasks %>   <%= link_to "Complete", complete_task_path(task) %>   <%=h task.body %>   <%= link_to 'Edit', edit_task_path(task) %>   <%= link_to 'Destroy', task, :confirm => 'Are you sure?', :method => :delete %> <% end %>

</div>

routes.rb: map.resources :tasks, :collection => { :complete => :post }

Controller: def complete     @task = Task.find(params[:id])     @task.completed = true   end

Right now I am getting undefined method for complete_task_path. Why is that? And how do I turn this into a checkbox? I want the checkbox to call the complete method.

I need to do more reading it looks like. Thank you Ryan

That's easy to remember. Thanks again

Maybe you can answer this Ryan.

Do I still do :render layout => false when pushing out an rjs format when using a RESTful design? My complete.js.rjs isn't being called.

def complete     @task = Task.find(params[:id])     @task.completed = true     render :layout => false   end

Ah ok, here is my problem:

in my log I see: Parameters: {"action"=>"3", "id"=>"complete", "controller"=>"tasks"}

That's pretty weird no? Why would <%= link_to "Complete", complete_task_path(task) %> let it think the action = the id?

I have this: map.resources :tasks, :member => { :complete => :put }

above

map.connect ':controller/:action/:id' map.connect ':controller/:action/:id.:format'