# Best route for has\_many subrecords

**URL:** <https://www.ruby-forum.com/t/best-route-for-has-many-subrecords/154709>\
**Category:** Rails\
**Created:** [December 3, 2008, 6:08am UTC](https://www.ruby-forum.com/t/best-route-for-has-many-subrecords/154709 "2008-12-03T06:08:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![oldbug](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@oldbug](https://www.ruby-forum.com/u/oldbug)\
**Post date:** [December 3, 2008, 6:08am UTC](https://www.ruby-forum.com/t/best-route-for-has-many-subrecords/154709/1 "2008-12-03T06:08:56Z")

</div>

Hello all,  
I have a model, say it’s called Person, which has\_many Responsibilities.  
I  
would like the “show” view for the person controller to list all of the  
responsibilities for that person. (That’s the easy part – I think I  
know  
how to do that part.) At the end of the list, I would like to include a  
text field into which a new responsibility may be added. What route  
should  
I use for the “Add” button next to that text box?

I am, perhaps, confused, because I’m using RESTful routing, and I can’t  
figure out how to map this sort of action (add/update one of the  
subrecords  
of a has\_many association) into a RESTful route. Perhaps wanting to do  
this  
sort of thing from the “show” view is not compatible with RESTful  
routing.

I suppose I could create a controller just for the Responsibilities  
model,  
and I could nest the routes for that inside the routes for the Person  
routes, but that seems like overkill, especially since I only need to be  
able to create and edit responsibilities.

Or is it? Is that the “Rails Way” to do this sort of thing?

–wpd
