Created
April 28, 2011 16:09
-
-
Save jamesgecko/946663 to your computer and use it in GitHub Desktop.
In which James learns that redirect_to is not instant.
This file contains 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 SessionController < ApplicationController | |
def index_attempt_one | |
if !session[:unset_key] | |
redirect_to :action => 'login' | |
end | |
# Anything here gets executed too! D-: | |
end | |
def index_attempt_two | |
if !session[:unset_key] | |
redirect_to :action => 'login' | |
else | |
# Now we are safe. -_- | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment