# Routing errors in production, RoR 1.2+

**URL:** <https://www.ruby-forum.com/t/routing-errors-in-production-ror-1-2/91075>\
**Category:** Rails\
**Created:** [April 4, 2007, 11:42am UTC](https://www.ruby-forum.com/t/routing-errors-in-production-ror-1-2/91075 "2007-04-04T11:42:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roland\_Bali](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/d07c76/32.png) [@Roland\_Bali](https://www.ruby-forum.com/u/Roland_Bali)\
**Post date:** [April 4, 2007, 11:42am UTC](https://www.ruby-forum.com/t/routing-errors-in-production-ror-1-2/91075/1 "2007-04-04T11:42:10Z")

</div>

The application I’m working on has two user controllers. One is the  
main page a user reaches when after login /user/index.html and the  
other is a user administration page located at /admin/user/index.html.

When deploying into production I can not reach the admin page, Rails  
always render the regular user page even though the browser URL says /  
admin/user/index.html?

Anybody know what could be wrong, I haven’t made any changes to  
routes.rb and I’ve only added a admin/user folder to controllers and  
views.

Kind regards,  
Roland

---

<div class="post-metadata">

**Author:** ![Roland\_Bali](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/d07c76/32.png) [@Roland\_Bali](https://www.ruby-forum.com/u/Roland_Bali)\
**Post date:** [April 4, 2007, 8:53pm UTC](https://www.ruby-forum.com/t/routing-errors-in-production-ror-1-2/91075/2 "2007-04-04T20:53:54Z")

</div>

You’re correct, sorry about that the URL:s are /user and /admin/user.  
They both render files named index.rhtml in views/user and views/admin/  
user.

As I understand this kind of routing, using subfolders, should work or  
would I have to rename /admin/user to something else?!

Kind regards,  
Roland

---

<div class="post-metadata">

**Author:** ![Roland\_Bali](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/d07c76/32.png) [@Roland\_Bali](https://www.ruby-forum.com/u/Roland_Bali)\
**Post date:** [April 4, 2007, 3:53pm UTC](https://www.ruby-forum.com/t/routing-errors-in-production-ror-1-2/91075/3 "2007-04-04T15:53:10Z")

</div>

Why are you using .html at the end of you URIs? I don’t know if that  
would  
solve anything but I can’t imagine why you’d need to do that.

RSL

---

<div class="post-metadata">

**Author:** ![Roland\_Bali](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/d07c76/32.png) [@Roland\_Bali](https://www.ruby-forum.com/u/Roland_Bali)\
**Post date:** [April 4, 2007, 11:02pm UTC](https://www.ruby-forum.com/t/routing-errors-in-production-ror-1-2/91075/4 "2007-04-04T23:02:11Z")

</div>

They should work as you’ve described. You say they do actually work that  
way  
on your desktop? If you’ve written some functional tests you might try  
running them on the server as well. assert\_template would clear the  
whole  
matter up, sounds like.

RSL

---

<div class="post-metadata">

**Author:** ![Roland\_Bali](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/d07c76/32.png) [@Roland\_Bali](https://www.ruby-forum.com/u/Roland_Bali)\
**Post date:** [April 5, 2007, 9:07am UTC](https://www.ruby-forum.com/t/routing-errors-in-production-ror-1-2/91075/5 "2007-04-05T09:07:10Z")

</div>

Yes it works in development but when I deploy in production it  
doesn’t. I’m using WEBrick when developing and Mongrel in production  
but that shouldn’t be a problem as I understand since the routing is  
in Rails and not in the server.

The weird thing is that it works if I access the /admin/user URL  
_before_ /user after startup. But if I go to /user first after startup  
I can never reach /admin/user without a restart.

I haven’t tried the functional test thing, I’ll have to look in to  
that, haven’t written tests before.

/Roland
