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 Attachments: http://www.ruby-forum.com/attachment/1231/controller_structure.png -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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"} -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
anyone ? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 12/31/07, Rupert Fisher <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> 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 Donald http://destiney.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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? Attachments: http://www.ruby-forum.com/attachment/1238/Picture_1.png -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---