0
我使用這個to_param軌路由 - 不會404錯誤的地址
def to_param
[id, [first_name.parameterize,last_name.parameterize].join("_")].join("-")
end
產生看起來像
http://www.example.com/users/34-joe_smith
但地址,如果我的地址更改爲
http://www.example.com/users/34-joe_notsmith
它仍將我引導至ID爲34的用戶。
如何執行它以轉到404頁面或root_path?