# non-RESTful action or nested routes?

**URL:** <https://www.ruby-forum.com/t/non-restful-action-or-nested-routes/153415>\
**Category:** Rails\
**Created:** [November 16, 2008, 10:27pm UTC](https://www.ruby-forum.com/t/non-restful-action-or-nested-routes/153415 "2008-11-16T22:27:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![davetron5000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a3d4f5/32.png) [@davetron5000](https://www.ruby-forum.com/u/davetron5000)\
**Post date:** [November 16, 2008, 10:27pm UTC](https://www.ruby-forum.com/t/non-restful-action-or-nested-routes/153415/1 "2008-11-16T22:27:58Z")

</div>

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
