Class: Users::ActivationsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Users::ActivationsController
- Defined in:
- lib/metajp/templates/controllers/admin/admin_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
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 account_url else render :action => :new end end |
#new ⇒ Object
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 |