Controller namespace problem?

I’m not getting any love grouping controllers into separate namespaces
and I’m hoping someone can tell me what I’m not getting:

$ rails foo
$ cd foo
$ script/generate controller Namespace::Bar index
$ script/server

$ lynx http://localhost:3000/namespace/bar
-> 404
-> Routing Error
-> Recognition failed for “/namespace/bar”

Many thanks in advance.

Hello Erik,

-> 404
-> Routing Error
-> Recognition failed for “/namespace/bar”

Can you show us what does your config/routes.rb look
like ?

РJean-Fran̤ois.

Jean-François wrote:

Hello Erik,

-> 404
-> Routing Error
-> Recognition failed for “/namespace/bar”

Can you show us what does your config/routes.rb look
like ?

РJean-Fran̤ois.

It’s stock as generated in the example. I have changed my routes.rb to
specify the namespace and that works, I just thought it was free. I
added this above the default route:

map.connect ‘namespace/bar/:action/:id’ :controller => ‘namespace/bar’

and it works. Thanks.

Can you show us what does your config/routes.rb look
like ?

That would definitely help, but I had something similar so you can give
this
a try.

In config/routes.rb:

map.connect ‘:controller/:action’
map.connect ‘:controller/:action/:id’

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs