Class: ActiveAuthentication::RegistrationsController
- Inherits:
-
ActiveAuthenticationController
- Object
- ApplicationController
- ActiveAuthenticationController
- ActiveAuthentication::RegistrationsController
- Defined in:
- app/controllers/active_authentication/registrations_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/active_authentication/registrations_controller.rb', line 9 def create @user = User.new registration_params if @user.save sign_in @user redirect_to root_path, notice: t(".success") else render :new, status: :unprocessable_entity end end |
#destroy ⇒ Object
31 32 33 34 35 |
# File 'app/controllers/active_authentication/registrations_controller.rb', line 31 def destroy current_user.destroy sign_out redirect_to root_url, notice: t(".success") end |
#edit ⇒ Object
20 21 |
# File 'app/controllers/active_authentication/registrations_controller.rb', line 20 def edit end |
#new ⇒ Object
5 6 7 |
# File 'app/controllers/active_authentication/registrations_controller.rb', line 5 def new @user = User.new end |
#update ⇒ Object
23 24 25 26 27 28 29 |
# File 'app/controllers/active_authentication/registrations_controller.rb', line 23 def update if current_user.update(profile_params) redirect_to edit_profile_path, notice: t(".success") else render :edit, status: :unprocessable_entity end end |