Class: Users::ActivationsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
lib/metajp/templates/controllers/admin/admin_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

Raises:

  • (Exception)


9
10
11
12
13
14
15
16
17
18
19
# File 'lib/metajp/templates/controllers/admin/admin_controller.rb', line 9

def create
  @user = User.find(params[:id])
  raise Exception if @user.active?
  if @user.activate!(params)
    @user.deliver_activation_confirmation!
    flash[:notice] = "Your account has been activated."
    redirect_to 
  else
    render :action => :new
  end
end

#newObject

Raises:

  • (Exception)


4
5
6
7
# File 'lib/metajp/templates/controllers/admin/admin_controller.rb', line 4

def new
  @user = User.find_using_perishable_token(params[:perishable_token], 1.week) || (raise Exception)
  raise Exception if @user.active?
end