Skip to content

Instantly share code, notes, and snippets.

@antico5
Created March 13, 2019 15:31
Show Gist options
  • Save antico5/f1fe6f4b06daaa28affe7a558f11976d to your computer and use it in GitHub Desktop.
Save antico5/f1fe6f4b06daaa28affe7a558f11976d to your computer and use it in GitHub Desktop.
catch-all action
get '*a', to: 'errors#error_404'
def error_404
if request.format.html?
render :error_404, status: 404
else
head 404, content_type: 'text/html'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment