如何在开发环境中报告错误时禁用rollbar gem?我只想从暂存和制作中获取错误,但我没有在Rollbar网站上的文档中找到它.
如何将不正确的URL重定向到routes.rb中的404页面?现在我使用2个示例代码:
# example 1
match "/go/(*url)", to: redirect { |params, request| Addressable::URI.heuristic_parse(params[:url]).to_s }, as: :redirect, format: false
# example 2
match "/go/(*url)", to: redirect { |params, request| Addressable::URI.heuristic_parse(URI.encode(params[:url])).to_s }, as: :redirect, format: false
Run Code Online (Sandbox Code Playgroud)
但是当我尝试在'url'参数中使用俄语单词时,在第一个例子中我得到500页(坏URI),在第二个 - 我得到重定向到stage.example.xn - org-yedaaa1fbbb/
谢谢