app/controllers/users_controller.rb
# Be sure to include AuthenticationSystem in Application Controller instead
Be sure to include AuthenticationSystem in Application Controller instead
Be sure to include AuthenticationSystem in Application Controller instead
def activate
        logout_keeping_session!
        user = User.find_by_activation_code(params[:activation_code]) unless params[:activation_code].blank?
        case
        when (!params[:activation_code].blank?) && user && !user.active?
            user.activate!
            flash[:notice] = "Signup complete! Please sign in to continue."
            redirect_to '/login'
        when params[:activation_code].blank?
            flash[:error] = "The activation code was missing.  Please follow the URL from your email."
            redirect_back_or_default('/')
        else 
            flash[:error]  = "We couldn't find a user with that activation code -- check your email? Or maybe you've already activated -- try signing in."
            redirect_back_or_default('/')
        end
    end
def activate logout_keeping_session! user = User . find_by_activation_code ( params [ :activation_code ] ) unless params [ :activation_code ] . blank? case when ( ! params [ :activation_code ] . blank? ) && user && ! user . active? user . activate! flash [ :notice ] = "Signup complete! Please sign in to continue." redirect_to '/login' when params [ :activation_code ] . blank? flash [ :error ] = "The activation code was missing.  Please follow the URL from your email." redirect_back_or_default ( '/' ) else flash [ :error ] = "We couldn't find a user with that activation code -- check your email? Or maybe you've already activated -- try signing in." redirect_back_or_default ( '/' ) end end
Be sure to include AuthenticationSystem in Application Controller instead
Be sure to include AuthenticationSystem in Application Controller instead