In my routes file:
map.foo :controller => 'bar', :action => 'index'
I have a bar controller an开发者_如何学JAVAd I'm including it when adding this route, any idea why it throwing this error?
Illegal route: the :controller must be specified! (ArgumentError)
using rails 2.3.5
thanks in advance!
You forgot to specify the URL you want to match.
map.foo '/foo/bar', :controller => 'bar', :action => 'index'
http://guides.rubyonrails.org/v2.3.8/routing.html#named-routes
You are missing the actual route:
map.foo '/foo', :controller => 'bar', :action => 'index'
精彩评论