# One url with multiple controllers

**URL:** <https://www.ruby-forum.com/t/one-url-with-multiple-controllers/168970>\
**Category:** Rails\
**Created:** [May 27, 2009, 10:32pm UTC](https://www.ruby-forum.com/t/one-url-with-multiple-controllers/168970 "2009-05-27T22:32:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 27, 2009, 10:32pm UTC](https://www.ruby-forum.com/t/one-url-with-multiple-controllers/168970/1 "2009-05-27T22:32:37Z")

</div>

Lets say that I want to have one url that can map to two different  
controllers. For example /posts could map to controller ‘public/  
posts’ or to the controller ‘admin/posts’ based on whether or not the  
user has logged in. This isn’t a great example because I could just  
use ‘/admin/posts’, but in my scenario the url has to be the same.

I was hoping to use a before\_filter to either render one action or the  
other. It looks like render\_component would have let me accomplish  
this, but it has been deprecated.

Thanks!  
Tom
