Skip to content

Instantly share code, notes, and snippets.

@bensie
Created April 22, 2009 22:53
Show Gist options
  • Save bensie/100145 to your computer and use it in GitHub Desktop.
Save bensie/100145 to your computer and use it in GitHub Desktop.
# 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