Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试将 URL 路由stats/non-existent-page到默认的“未找到”页面,我想在其中显示“您的意思是”建议以及未找到的消息,如何将所有不存在的 URL 路由到默认值控制器/动作?
stats/non-existent-page
就像是:
match 'stats/*path' => 'default#non_existent'
在您的其他 'stats/..' urls 之后添加它,这会将您的所有 stats/* 路径路由到使用path变量提到的控制器操作,您可以使用该变量来确定您的“您的意思是”建议..
path