Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 14th, 2012  |  syntax: None  |  size: 0.42 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. class ActivationsController < ApplicationController
  2.   before_filter :require_no_user, :only => [:new, :create]
  3.   def new
  4.     @user = User.find_using_perishable_token!(params[:activation_code], 1.week)
  5.     redirect_to(login_url, :notice => "Your account is already active. Please login.") if @user.active?
  6.    
  7.     rescue_from ActiveRecord::RecordNotFound do |exception|
  8.       redirect_to(resend_activation_path)
  9.     end
  10.   end