Module: Revise::Controllers::Confirmations

Defined in:
lib/revise/controllers/confirmations.rb

Class Method Summary collapse

Class Method Details

.extended(klass) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/revise/controllers/confirmations.rb', line 4

def self.extended(klass)
  klass.controllers :accounts do
    get :confirm, :map => '/accounts/confirm/:confirmation_token', :priority => :low do
       = Account.confirm_by_token(params[:confirmation_token])
      if 
        if .errors.empty?
          flash[:notice] = "Account Confirmed Please Login"
          render 'accounts/confirmed'
        else
          flash[:error] = .errors.full_messages()
          render 'accounts/confirmed'
        end
      else
        flash[:error] = "Token Does Not Exist"
        status 404
        render 'accounts/confirmation_token_404'
      end
    end
  end
end