I''m currently developing a project in which I want to have an administration section. The development server is running with Bluehost (bluehost.com) on a shared server plan (since I am not always developing on one machine, and need to have mobility in development). I have created a number of controllers as nested controllers. For example: http://domain.com/acumen/ http://domain.com/acumen/users/ http://domain.com/acumen/tasklists/ http://domain.com/acumen/projects/ http://domain.com/acumen/tasks/ etc. The folder structure in the /controllers/ folder mirrors what you see there. As far as I can tell, this should work perfectly - I''ve read a number of tutorials that do this just as I have done this, and they all seem to work. Unfortunately, it is not working. Whenever I try to access one of the controllers underneath the acumen controller, I get the following error: Routing Error Recognition failed for "/acumen/tasks/" My routes.rb file has the following routes in the following order. I have also shown a few things that I have tried to resolve the routing problems, but they are commented out, as you can see, and should not affect right now: ActionController::Routing::Routes.draw do |map| map.connect '''', :controller => "home" map.connect '':controller/service.wsdl'', :action => ''wsdl'' # Routes to our acumen controller? #map.connect ''acumen/:controller/:action/:id'' #map.connect ''acumen/projects/:action'', :controller => ''projects'' map.connect '':controller/:action/:id'' end Is this perhaps a problem with the Bluehost hosting environment? -- 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/19/06, Bryan Cox <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I have created a number of controllers as nested controllers. For > example: > > http://domain.com/acumen/ > http://domain.com/acumen/users/ > http://domain.com/acumen/tasklists/ > http://domain.com/acumen/projects/ > http://domain.com/acumen/tasks/ > etc. > > The folder structure in the /controllers/ folder mirrors what you see > there. As far as I can tell, this should work perfectly - I''ve read a > number of tutorials that do this just as I have done this, and they all > seem to work. Unfortunately, it is not working. > > Whenever I try to access one of the controllers underneath the acumen > controller, I get the following error: > > Routing Error > > Recognition failed for "/acumen/tasks/" > > My routes.rb file has the following routes in the following order. I > have also shown a few things that I have tried to resolve the routing > problems, but they are commented out, as you can see, and should not > affect right now: > > ActionController::Routing::Routes.draw do |map| > map.connect '''', :controller => "home" > > > map.connect '':controller/service.wsdl'', :action => ''wsdl'' > > # Routes to our acumen controller? > #map.connect ''acumen/:controller/:action/:id'' > > #map.connect ''acumen/projects/:action'', :controller => ''projects'' > > map.connect '':controller/:action/:id'' > end > > Is this perhaps a problem with the Bluehost hosting environment?All you need is the default route and a controller like # app/controllers/acument/tasks_controller.rb class Acumen::TasksController < ApplicationController ... end jeremy --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Bryan Cox wrote:> The folder structure in the /controllers/ folder mirrors what you see > there.Can you be more explicit - just so I know exactly how your /app/controllers folder looks first? Is it: /app/controllers/acumen/ /app/controllers/acumen/users/ /app/controllers/acumen/tasklists/ /app/controllers/acumen/projects/ /app/controllers/acumen/tasks/ or /app/controllers/ /app/controllers/users/ /app/controllers/tasklists/ /app/controllers/projects/ /app/controllers/tasks/ -- 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 -~----------~----~----~----~------~----~------~--~---
It is:> /app/controllers/acumen/ > /app/controllers/acumen/users/ > /app/controllers/acumen/tasklists/ > /app/controllers/acumen/projects/ > /app/controllers/acumen/tasks/-- 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 -~----------~----~----~----~------~----~------~--~---
Ok well assuming you are wanting to connect to a controller in the acumem folder, say ''TestController'', i.e. /app/controllers/acumen/test_controller.rb Then you need this in the routes.rb map.connect ''acumen/:controller/:action/:id'' No this should work is you go to URL: /acumen/test It''s the controller names that matter, not the folders. Rails doesn''t care which folders you put your controllers in beneath the /app/controllers folder (they are all in the same namespace). -- 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 -~----------~----~----~----~------~----~------~--~---
I activated that route just below the WSDL route. Currently I''m receiving this error: Unknown action No action responded to projects This leads me to think that it is reading it as the acumen controller, action projects? Note: You mentioned namespace. My sub-controllers are declared like this: class Acumen::ProjectsController < AcumenAreaController Where I have substituted AcumenArea Controller for ApplicationController, so that my layout and login requirements are consolidated in a single place. AcumenAreaController looks like this: class AcumenAreaController < ApplicationController before_filter :login_required layout "site-layout" end> map.connect ''acumen/:controller/:action/:id''-- 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 -~----------~----~----~----~------~----~------~--~---
ryan.raaum-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Dec-20 03:35 UTC
Re: Nested Controllers
On Dec 19, 8:59 pm, Bryan Cox <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I activated that route just below the WSDL route. Currently I''m > receiving this error: > > Unknown action > > No action responded to projects > > This leads me to think that it is reading it as the acumen controller, > action projects? > > Note: You mentioned namespace. My sub-controllers are declared like > this: > > class Acumen::ProjectsController < AcumenAreaController > > Where I have substituted AcumenArea Controller for > ApplicationController, so that my layout and login requirements are > consolidated in a single place. AcumenAreaController looks like this: > > class AcumenAreaController < ApplicationController > before_filter :login_required > layout "site-layout" > end > > > map.connect ''acumen/:controller/:action/:id''-- > Posted viahttp://www.ruby-forum.com/.Is this Rails Weenie thread helpful? http://rails.techno-weenie.net/forums/1/topics/544 Best, -r -- Ryan Raaum http://raaum.org http://rails.raaum.org -- Rails docs http://locomotive.raaum.org -- Self contained Rails for Mac OS X --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Just an idea... try it with all the controllers subclassing the ApplicationController instead and see if that works, i.e. class Acumen::ProjectsController < ApplicationController If so, then using the module name ''Acumen'' is causing the problem. Just use a different name from ''Acumen'' in case it conflicts with the path /acumen/ -- 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 -~----------~----~----~----~------~----~------~--~---