Route not working

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?

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.

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?

and this blog_controller.rb would look like…
class Admin::BlogController < ApplicationController

What about the route and map.resources?

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
[email protected]