更新时间:2023-11-24 20:04:28
如果有人仍在寻找答案,我会请参阅此答案
https://***.com/a/25842118/697816
If anyone is still looking for an answer for this, I would refer to this answer https://***.com/a/25842118/697816
在 application_controller.rb
在
下rescue_from ActionController :: RoutingError,带有:-> {render_404}
添加
rescue_from ArgumentError,带有:-> {render_404}
这将完全捕获所有 ArgumentError