48
This seems good...
# 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
You can also
raise ActiveRecord::RecordNotFound
exception.
In the ApplicationController define a method like:
def render_404
render status: 404, layout: false file: Rails.root.join("public/404.html")
end