# Route not working

**URL:** <https://www.ruby-forum.com/t/route-not-working/183031>\
**Category:** Rails\
**Created:** [February 6, 2010, 1:26pm UTC](https://www.ruby-forum.com/t/route-not-working/183031 "2010-02-06T13:26:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [February 6, 2010, 1:26pm UTC](https://www.ruby-forum.com/t/route-not-working/183031/1 "2010-02-06T13:26:11Z")

</div>

I’ve added a controller ‘blog/admin’. When I want to access  
‘blog/admin/index’ it says that the page doesn’t exist. It works in my  
local environment. What am I missing?

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [February 6, 2010, 1:41pm UTC](https://www.ruby-forum.com/t/route-not-working/183031/2 "2010-02-06T13:41:21Z")

</div>

On Sat, 2010-02-06 at 13:26 +0100, Pål Bergström wrote:

> I’ve added a controller ‘blog/admin’. When I want to access  
> ‘blog/admin/index’ it says that the page doesn’t exist. It works in my  
> local environment. What am I missing?

* * *

conventionally, most people would have…

app  
/controllers  
/helpers  
/models  
/views

and then maybe inside…  
app  
/controllers  
/admin  
/blog\_controller.rb

and this blog\_controller.rb would look like…  
class Admin::BlogController \< ApplicationController

but since you don’t actually give us paths or the actual error, it’s  
hard to say what you are missing but you could probably fix anything in  
routes.rb if you really want to.

when you say that you’ve added blog/admin, the route and mechanics are  
unclear.

Craig

–  
This message has been scanned for viruses and  
dangerous content by MailScanner, and is  
believed to be clean.

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [February 6, 2010, 2:03pm UTC](https://www.ruby-forum.com/t/route-not-working/183031/3 "2010-02-06T14:03:05Z")

</div>

Craig W. wrote:

> On Sat, 2010-02-06 at 13:26 +0100, Pï¿½l Bergstrï¿½m wrote:

> when you say that you’ve added blog/admin, the route and mechanics are  
> unclear.

You’re right. A better way is to add a  
/controller/admin/blog\_controller.rb. I think I’ll do that instead. More  
in line with what I’ve done before. Thanks.

I tried /controller/blog/admin/. It works locally. I thought my  
information was rather clear and hoped someone would say “aha, you’re  
missing …”. I don’t understand why it works locally but not on the  
remote server?

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [February 12, 2010, 1:09pm UTC](https://www.ruby-forum.com/t/route-not-working/183031/4 "2010-02-12T13:09:30Z")

</div>

> and this blog\_controller.rb would look like…  
> class Admin::BlogController \< ApplicationController

What about the route and map.resources?

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [February 6, 2010, 3:10pm UTC](https://www.ruby-forum.com/t/route-not-working/183031/5 "2010-02-06T15:10:10Z")

</div>

PÃ¥l BergstrÃ¶m wrote:

> Craig W. wrote:
> 
> > On Sat, 2010-02-06 at 13:26 +0100, Pï¿½l Bergstrï¿½m wrote:
> 
> > when you say that you’ve added blog/admin, the route and mechanics are  
> > unclear.
> 
> You’re right. A better way is to add a  
> /controller/admin/blog\_controller.rb. I think I’ll do that instead. More  
> in line with what I’ve done before. Thanks.

You missed Craig’s point. There’s nothing wrong with the name of your  
controller; rather, Craig said (and I agree) that you didn’t provide  
enough information for us to help. Output from rake routes might be  
helpful.

> I tried /controller/blog/admin/. It works locally. I thought my  
> information was rather clear and hoped someone would say “aha, you’re  
> missing …”. I don’t understand why it works locally but not on the  
> remote server?

Are your routes files different?

Best,  
–Â  
Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
