# Setup has\_many routes

**URL:** <https://www.ruby-forum.com/t/setup-has-many-routes/175546>\
**Category:** Rails\
**Created:** [September 15, 2009, 1:35pm UTC](https://www.ruby-forum.com/t/setup-has-many-routes/175546 "2009-09-15T13:35:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@jamal](https://www.ruby-forum.com/u/jamal)\
**Post date:** [September 15, 2009, 1:35pm UTC](https://www.ruby-forum.com/t/setup-has-many-routes/175546/1 "2009-09-15T13:35:25Z")

</div>

Hi,

I’m trying to accomplices this with REST 🙂

[http://localhost:3000/admin/projects/11/tasks/assigns/:user\_id](http://localhost:3000/admin/projects/11/tasks/assigns/:user_id)

This is my route config.

map.namespace :admin do |admin|  
admin.resources :projects, :has\_many =\> {:tasks =\> {:assigns =\>  
:post}}  
admin.resources :tasks  
end

But I’m not getting it right?

Can anyone show me the correct way of doing that 🙂

I also tried:  
admin.resources :projects, :has\_many =\> {:tasks, :collection =\>  
{:assigns =\> :post}}

Thanks for help.

---

<div class="post-metadata">

**Author:** ![jamal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@jamal](https://www.ruby-forum.com/u/jamal)\
**Post date:** [September 15, 2009, 1:46pm UTC](https://www.ruby-forum.com/t/setup-has-many-routes/175546/2 "2009-09-15T13:46:26Z")

</div>

Well, that wasn’t hard 😃

map.namespace :admin do |admin|  
admin.resources :projects do |project|  
project :tasks, :collection =\> {:assigns =\> :post}  
end  
admin.resources :tasks  
end
