相关疑难解决方法(0)

Rails - 如何处理不存在的路由("没有路由匹配[GET]")?

我的route样子

match 'about' => 'company#about'
Run Code Online (Sandbox Code Playgroud)

当我设置为URL时http://localhost:3000/aboutttt,我收到错误消息

No route matches [GET] "/aboutttt"
Run Code Online (Sandbox Code Playgroud)

我想给用户更好的反馈.

我认为最好的解决方案可能是重定向应用程序,或者在应用程序的主页上,但是当我得到上述错误时,以任何方式存在于路由中以设置默认路由?

ruby routes ruby-on-rails-3

4
推荐指数
2
解决办法
6379
查看次数

标签 统计

routes ×1

ruby ×1

ruby-on-rails-3 ×1