Created
October 17, 2008 22:21
-
-
Save lifo/17549 to your computer and use it in GitHub Desktop.
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 | |
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