# Multiple controllers links

**URL:** <https://www.ruby-forum.com/t/multiple-controllers-links/152876>\
**Category:** Rails\
**Created:** [November 8, 2008, 8:57pm UTC](https://www.ruby-forum.com/t/multiple-controllers-links/152876 "2008-11-08T20:57:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chandraruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/96bed5/32.png) [@chandraruby](https://www.ruby-forum.com/u/chandraruby)\
**Post date:** [November 8, 2008, 8:57pm UTC](https://www.ruby-forum.com/t/multiple-controllers-links/152876/1 "2008-11-08T20:57:32Z")

</div>

Hello experts,

I’ve got two different models and controllers. Lets call them Author  
and Book respectively. Also Author has\_many :books, and Book  
belong\_to :author.

with this setup I get urls looking like  
[http://localhost:3000/author/14/book/173](http://localhost:3000/author/14/book/173).

Is there a way to get rid of the ‘book’ controller name from the url?  
I’d be more happy to see [http://localhost:3000/author/14/173](http://localhost:3000/author/14/173) instead.

Or my design is completely wrong and I am missing something importing?

I hope this can be accomplished with a routes, but not sure how.

Please point me out to the right direction.

Regards,  
Chandra

---

<div class="post-metadata">

**Author:** ![chandraruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/96bed5/32.png) [@chandraruby](https://www.ruby-forum.com/u/chandraruby)\
**Post date:** [November 11, 2008, 10:12pm UTC](https://www.ruby-forum.com/t/multiple-controllers-links/152876/2 "2008-11-11T22:12:15Z")

</div>

you could probably just set up your own route in config/routes.rb for  
it, or maybe some of the configuration options for map.resources can  
do it:  
[http://api.rubyonrails.org/classes/ActionController/Resources.html#M000337](http://api.rubyonrails.org/classes/ActionController/Resources.html#M000337)

On Nov 8, 1:55 pm, “chandra s.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
