Here’s where I am right now:
View:
<% 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 %>
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.