从 Rails Controller 操作发出 404 响应的首选方式是什么?
最佳答案
这看起来不错...
# Rails 2 and below
render :file => "#{RAILS_ROOT}/public/404.html", :status => 404
# Rails 3 and up
render :file => "#{Rails.root}/public/404.html", :status => 404
关于ruby-on-rails - 如何从 Rails Controller 操作发出 404 响应?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/779784/