# Splitting resources or not

**URL:** <https://www.ruby-forum.com/t/splitting-resources-or-not/104092>\
**Category:** Rails\
**Created:** [May 14, 2007, 9:09am UTC](https://www.ruby-forum.com/t/splitting-resources-or-not/104092 "2007-05-14T09:09:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [May 14, 2007, 9:09am UTC](https://www.ruby-forum.com/t/splitting-resources-or-not/104092/1 "2007-05-14T09:09:02Z")

</div>

I have a resource named ‘users’ and another one ‘posts’, but these one  
can have ‘offers’ or ‘requests’…

shouild I define 2 other resources or keep only one, using something  
like :

map.resources :users, :collection =\> { :offer =\> :get }  
map.resources :users, :collection =\> { :request =\> :get }

which will give me helper methods like :

offer\_users\_url #=\> “/users;offer”  
request\_users\_url #=\> “/users;request”

and adding my own prefix to the generated url name:

map.resources :users, :collection =\> { :offer =\> :get }, :name\_prefix =\>  
‘my\_’  
map.resources :users, :collection =\> { :request =\> :get }, :name\_prefix  
=\> ‘my\_’

giving  
my\_offer\_users\_url #=\> “/users;offer”  
my\_offer\_users\_url #=\> “/users;offer”

what is the best design ? one or 2 resources …

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [May 14, 2007, 7:07pm UTC](https://www.ruby-forum.com/t/splitting-resources-or-not/104092/2 "2007-05-14T19:07:35Z")

</div>

On May 14, 2:09 am, Kad K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I have a resource named ‘users’ and another one ‘posts’, but these one  
> can have ‘offers’ or ‘requests’…

Can you explain this just a bit more? What are these “offers” and  
“requests”, and how are they represented in your model associations?

Jeff
