On Sun, 2010-03-07 at 04:57 +0100, Phillip Koebbe wrote:
> I have a utility controller that has an action in it. Before I changed
> to namespaced controllers, I could access the action with:
> 
> /utility/my_action
> 
> There are no resources associated with the controller, so I'm assuming
> the stock route
> 
> map.connect ':controller/:action/:id'
> 
> picked it up. However, for reasons I don't want to go into detail about,
> I moved the utility controller into a namespace (Web), and the route
> started failing. Ultimately, I added
> 
> map.connect 'web/utility/:action', :controller => 'web/utility'
> 
> to routes.rb and it started working again. I do not understand why I had
> to specify 'web/utility' in the map.connect statement. Why didn't the
> stock map.connect pick it up? And why wouldn't
> 
> map.connect 'web/:controller/:action'
> 
> work?
----
assuming that the first line of
app/controllers/web/utility_controller.rb looks like

class Web::UtilityController < ApplicationController

I don't think you really need to do a whole lot with routes.rb at all
(the views would necessarily have to follow a similar pathing in
app/views/web/utility) but I also wonder whether you are using the
plural utilities instead of the singular utility, etc.

Craig



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to