Skip to content

Instantly share code, notes, and snippets.

@floehopper
Created March 28, 2010 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save floehopper/346794 to your computer and use it in GitHub Desktop.
Save floehopper/346794 to your computer and use it in GitHub Desktop.
def activate
@user = User.find_using_perishable_token(params[:activation_code], 1.week)
if @user && @user.activate!
@user.deliver_activation_confirmation!
flash[:notice] = 'Your username has been entered in the form below. Simply click Login to enter your account!'
redirect_to login_url(:email => @user.email)
else
flash[:notice] = 'Either you activated it already Or that was an old request'
redirect_to login_url
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment