Class: Accountly::ConfirmationController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/accountly/confirmation_controller.rb

Instance Method Summary collapse

Instance Method Details

#new_emailObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/accountly/confirmation_controller.rb', line 4

def new_email
  @user = User.find_by_new_email_token( params[:token] ) unless params[:token].nil?
  if @user
    if @user.confirm_new_email!
      redirect_to( root_url, :notice => t( '.flash.success' ))
    else
      flash[:notice] = t( '.flash.error' )
    end
  else
    render :new_email_token
  end
end