开发者

Rails subrouting question

Hiya everyone! I need to put off some subroutes in a specific part of an application. The subroutes shouldbe something like this

map.connect ':wildcard/:controller/:id/:action' , :controller => 'my_fancy_controller'

problem is , it's not working. putting anything behind :controller will not help.

Environment is rails 2.3.10, not 3 :-).

Someone 开发者_运维知识库has some suggestion?


Apparently the answer was very very simple.

map.connect 'my_fancy_controller/:wildcard/sub_controller/:id/:action', :controller => 'my_fancy_controller/sub_controller' 

In this way i can use my_fancy_controller and sub_controller as static text in the url, declaring them in the :controller field.

Is not rest, but it's the way my job have to be done, so i'm sorry for you purists!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜