Rails: Turn off error display

前端 未结 1 1648
终归单人心
终归单人心 2021-01-03 07:48

When I access a post that doesn\'t exist in my Rails project via the URL /posts/13, the browser shows a verbose error:

ActiveRecord::RecordNotFo         


        
相关标签:
1条回答
  • 2021-01-03 08:15

    Try this:

    • run a server in production $ rails s -e production

    • remove ActionDispatch::DebugExceptions middleware

      config.middleware.delete(ActionDispatch::DebugExceptions)

    • set config.consider_all_requests_local = false in your environment config

    0 讨论(0)
提交回复
热议问题