Skip to content

Instantly share code, notes, and snippets.

@lifo
Created October 17, 2008 22:21
Show Gist options
  • Save lifo/17549 to your computer and use it in GitHub Desktop.
Save lifo/17549 to your computer and use it in GitHub Desktop.
class ApplicationController < ActionController::Base
class Redirection < ::ActionController::ActionControllerError
attr_reader :arguments
def initialize(*arguments)
@arguments = arguments
end
end
rescue_from Redirection do |e|
redirect_to *e.args
end
def redirect(*args)
raise Redirection.new(*args)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment