Rails - how to handle routes that don't exist (“No route matches [GET]”)?

a 夏天 提交于 2019-12-05 13:30:43

Run your app with the environment set to production and I think you'll find you'll no longer see this message. It's a convenience for debugging while you're developing.

There's a setting in config/environments/production.rb or config/environments/development.rb (I can't remember which way round) which controls whether exceptions are rendered as views. This is off for production - instead you get the 404.html that's in public, which you can change as you please.

While you are on development. Make changes inside config/environments/development.rb by setting: config.consider_all_requests_local = false

This will disable full error reporting and instead shows a page with interactive response for users. But this is already disabled on production environment. But I don't recommend turning it off in development mode.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!