non-RESTful action or nested routes?


#1

I’m creating a simple task management system to learn Rails. I have a
“task” which is part of a “project”, as so:

/projects/5/tasks

for project with id 5’s tasks

My task has a concept of being started, completed and updated.

“Updating” maps to the existing RESTful routes provided by Rails.

Started and completing, however, do not (at least not in an obvious
way). I don’t want to overload “update”, nor do I want to modify the
UI to fit “start task” into a form of update.

I can see two options:

1 - create named routes on task for “start” and “complete” (post to
these does the action in question)

2 - create subresources of project for “completed_tasks” and
“started_tasks” (where a post to /projects/5/completed_tasks/78 would
“complete” task #78 of project #5)

Which would be the “least surprising” way to do this, from a Rails
perspective?

Dave