Forum: Ruby on Rails splitting resources or not....

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Kad K. (Guest)
on 2007-05-14 11:09
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 ...
Jeff C. (Guest)
on 2007-05-14 21:07
(Received via mailing list)
On May 14, 2:09 am, Kad K. <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
This topic is locked and can not be replied to.