0
是否有可能創造routes.rb中快速重定向規則支持:修改PARAMS在Ruby中的路線重定向on Rails的
來源:
http://example.com/family/uid-123-child
要:
http://example.com/family/parent?child=123
我目前的解決方案如下。 Rails不允許我解析:id從中獲取數字「123」。你能幫忙嗎?
get "family/:id", to: redirect('/parent?child='.concat('%{id}')), :constraints => { :id => /[A-Za-z0-9_\-:]+\child?/}
工程很棒。非常感謝。 – kt2k
不客氣! – fivedigit