Skip to content

Instantly share code, notes, and snippets.

@tammersaleh
Created June 14, 2010 21:46
Show Gist options
  • Save tammersaleh/438363 to your computer and use it in GitHub Desktop.
Save tammersaleh/438363 to your computer and use it in GitHub Desktop.
class RoutingErrorRaiser
def initialize(app)
@app = app
end
def call(env)
status, headers, body = @app.call(env)
raise ActionController::RoutingError, "No route matches #{env['PATH_INFO'].inspect}" if headers['X-Cascade'] == 'pass'
[status, headers, body]
end
end
Lettercase::Application.configure do
config.middleware.use ::RoutingErrorRaiser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment