Rails rails url 传递 带英文句号的参数,路由该怎么匹配?

pobing · March 26, 2012 · Last by Saito replied at March 27, 2012 · 4208 hits

问题描述:此 http://localhost:3000/tags/a.bv 传递‘a.bv’这个参数,但控制器只接受到‘a’这个参数,bv 被当成另一个参数了,求路由如何配置?

get "tags/:post(/*path)"    => "tags#index", format: false

#1 楼 @Saito 问题已解决,match '/tags/*id' => 'tags#show' ,:format=>false thank you

#1 楼 @Saito 新 Hash 语法很别扭。

#3 楼 @Rei hash rocket 写起来好长啊。

好吧,其实我是倾向于用 1.9 的 : 的。

You need to Sign in before reply, if you don't have an account, please Sign up first.