Created
August 20, 2015 09:49
-
-
Save sharshenov/8d4f1509ed35c9a64f00 to your computer and use it in GitHub Desktop.
Page not found for RoR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Page not found</h1> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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