Nested Controllers - Development vs. Production

I have an infuriating problem!

Very excited about my app, working well and then I dropped it into
production (first deployment) and it continued to operate at first as
expected (I’ve learned an awful lot in the last 6 months and I was very
pleased).

I’m not sure what’s changed but now my redirect statements have gone
screwy, I’ve tried and tried to fix it but without success, so I’ve now
come here for some expert advice. Various redirects are giving me “The
page you were looking for doesn’t exist”, when the local version works -
the url is the same in both environments.

For now I’ve reset the things I’ve been playing with (routes file /
environment settings, various others) back to their defaults. I figure
this is caching / paths / relative paths or my biggest suspicion the
routes file. I want to stress that my app works fine on my Mac in
development, with a vanilla routes file. I’m pretty sure I’ve deployed
correctly.

I have attached a picture showing the structure of the directories, so
you can see my controllers.

An example redirect that works at home but not away would be this in my
signup controller…

redirect_to(:controller => ‘/owner/welcome’, :action => ‘index’)

My question is primarily, do I need to touch the routes file to get this
to work in production and if so, what edit do I make OR is it perhaps
something else I haven’t considered yet?

I’d be very grateful if someone could solve this one for me or perhaps
point me in the right direction.

Rgds,

bb

After some testing (and a default route file) I see this as the
problem…

With this in the controller…redirect_to(:controller =>
‘/owner/welcome’, :action => ‘index’)

interesting result…worked in dev…logged this in the log
Parameters: {“action”=>“index”, “controller”=>“owner/welcome”}
and page is rendered correctly…

in production i do the same actions and get the error rendered in the
browser

“The page you were looking for doesn’t exist.”

This is what i see in the log…
Parameters: {“action”=>“welcome”, “controller”=>“owner”}

anyone ?

On 12/31/07, Rupert F. [email protected] wrote:

An example redirect that works at home but not away would be this in my
signup controller…

redirect_to(:controller => ‘/owner/welcome’, :action => ‘index’)

Why do you need to put controllers in directories like that? Is there
any reason why you can’t put it in the normal controllers directory
and just make a custom route so the url appears like you want?


Greg D.
http://destiney.com/

I hadn’t realised it wasn’t a good thig to do. I do now.

I’ve restructured it, and it’s working much better now - in production
also.

Getting closer…

Not sure how to organise my Admin controller though as it needs CRUD
actions for BOTH owners AND properties…and ci cannot have two
actions of the same name in a single admin controller.

Any tips?