Skip to content

Instantly share code, notes, and snippets.

@sharshenov
Created August 20, 2015 09:49
Show Gist options
  • Save sharshenov/8d4f1509ed35c9a64f00 to your computer and use it in GitHub Desktop.
Save sharshenov/8d4f1509ed35c9a64f00 to your computer and use it in GitHub Desktop.
Page not found for RoR
<h1>Page not found</h1>
class ApplicationController < ActionController::Base
def not_found
respond_to do |format|
format.html {render :template => "404", :status => 404}
format.all {render :nothing => true, :status => 404}
end
end
end
# put this as last route
get "*path", :to => "application#not_found"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment