Class: Yellin::AccountActivationsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Yellin::AccountActivationsController
- Defined in:
- app/controllers/yellin/account_activations_controller.rb
Instance Method Summary collapse
Methods included from SessionsHelper
#current_user, #current_user?, #forget, #log_in, #log_out, #logged_in?, #logged_in_user, #redirect_back_or, #remember, #store_location
Instance Method Details
#edit ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/yellin/account_activations_controller.rb', line 6 def edit @user = Yellin.user_class.find_by(email: params[:email]) if @user && !@user.activated? && @user.authenticated?(:activation, params[:id]) @user.activate log_in @user flash[:success] = Yellin.flash[:activation_success] begin redirect_to @user rescue NoMethodError redirect_to main_app.root_url end else flash[:danger] = Yellin.flash[:activation_invalid] redirect_to main_app.root_url end end |