开发者

rails routing error: Controller required, when I am including controller

开发者 https://www.devze.com 2023-02-11 10:43 出处:网络
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 e

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'
0

精彩评论

暂无评论...
验证码 换一张
取 消