views:

44

answers:

1

I have a route which looks something like this:

map.namespace :a do |a|
  a.namespace :b do |b|
    b.connect ':controller/:action'
  end
end

I have a folder app/controllers/a/b which stores different controller files, all exist within a A::B module.

This route works well on my local machine but it doesn't work on the server I'm deploying to. When I try to browse to, for instance, http://mysite.com/a/b/cont/act I get an error that the controller b with action cont and id act is not found...

I'm using Rails 2.3.5 with Ruby 1.8.7 and my server runs nginx 0.7.64 with Passenger 2.2.8.

Any idea?

By the way, if I'm adding a full route, something like:

map.connect 'a/b/cont/:action', :controller => 'a/b/cont'

then it works...

A: 

After a few hours I solved it!

It turned out there was an AController controller class under folder a. This messed up rails, which tried to look after an action within this class and didn't even try to look inside folder B... Renaming AController to ALogicController fixed the problem.

I still don't know why it happens on this server and not on my local machine, though.

Shay Friedman