app/controllers/account_activations_controller.rb
#Activate users, checks for invalid activation tokens and updates user activation attributes
Activate users, checks for invalid activation tokens and updates user activation attributes
Activate users checks for invalid activation tokens and updates user activation attributes
def edit 
		user = User.find_by(email: params[:email])
		if user && !user.activated? && user.authenticated?(:activation, params[:id])
			user.activate
			log_in user
			flash[:success] = "Account activated!"
			redirect_to user
		else 
			flash[:danger] = "Invalid activation link"
			redirect_to root_url
		end
	end
def edit user = User . find_by ( email : params [ :email ] ) if user && ! user . activated? && user . authenticated? ( :activation , params [ :id ] ) user . activate log_in user flash [ :success ] = "Account activated!" redirect_to user else flash [ :danger ] = "Invalid activation link" redirect_to root_url end end
Activate users, checks for invalid activation tokens and updates user activation attributes
Activate users checks for invalid activation tokens and updates user activation attributes