Skip to content

Instantly share code, notes, and snippets.

@davidphasson
Forked from bensie/render404.rb
Created April 22, 2009 22:57
Show Gist options
  • Save davidphasson/100150 to your computer and use it in GitHub Desktop.
Save davidphasson/100150 to your computer and use it in GitHub Desktop.
Method for rendering a 404
# Painless method for rendering a 404 (not found) whenever it might be useful
def render_404
respond_to do |format|
format.html { render :file => "#{RAILS_ROOT}/public/404.html", :status => :not_found }
format.xml { head :not_found }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment