# REST nested resources and resource design

**URL:** <https://www.ruby-forum.com/t/rest-nested-resources-and-resource-design/106578>\
**Category:** Rails\
**Created:** [June 12, 2007, 5:27am UTC](https://www.ruby-forum.com/t/rest-nested-resources-and-resource-design/106578 "2007-06-12T05:27:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cjharrelson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c89c15/32.png) [@cjharrelson](https://www.ruby-forum.com/u/cjharrelson)\
**Post date:** [June 12, 2007, 5:27am UTC](https://www.ruby-forum.com/t/rest-nested-resources-and-resource-design/106578/1 "2007-06-12T05:27:26Z")

</div>

I have a situation where an account belongs\_to account\_type and  
account\_type has\_many accounts. Obviously, I also have an  
AccountTypeController and an AccountController.

I am trying to get a list of all accounts that are of account type  
‘user’ without breaking the REST conventions. What is the best way to  
achieve this?

I could accept an account\_type parameter in the index action of the  
AccountController and limit the list by this if it is present.

It also seems like I could go through the the AccountTypeContoller to  
achieve this, but I am at a loss for how.

Thank you in advance for your help!
