我正在创建一个应该有一个可选/忽略的最后一个术语的路线。
像这样:
/product/12345/Dark-Knight-Rises # last term is just there for a nice URL
通过阅读文档,我在想,我只能对最后一个术语进行通配符:
match 'product/:uid/*full_name' => 'product#view', :via => [:get]
那没有用。我确实让这个工作:
match 'product/:uid/:full_name' => 'product#view', :via => [:get]
match 'product/:uid' => 'product#view', :via => [:get]
但是,好吧,这似乎应该在一行中是可行的。是的?