Last active
August 1, 2024 08:35
Revisions
-
Turadg Aleahmad revised this gist
May 15, 2013 . 2 changed files with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes.File renamed without changes. -
Turadg Aleahmad revised this gist
May 13, 2013 . No changes.There are no files selected for viewing
-
Turadg Aleahmad created this gist
May 13, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ class ErrorsController < ApplicationController skip_before_filter :authenticate_user! # if using Devise def not_found 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ class CustomPublicExceptions < ActionDispatch::PublicExceptions def call(env) status = env["PATH_INFO"][1..-1] if "404" == status # handle just 404 in our routes MyApp::Application.routes.call env else super env 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ module MyApp class Application < Rails::Application require Rails.root + 'lib/custom_public_exceptions' config.exceptions_app = CustomPublicExceptions.new Rails.public_path 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ Geknowm::Application.routes.draw do match "/404", :to => "errors#not_found" end