Class: ReviseAuth::RegistrationsController
- Inherits:
-
ReviseAuthController
- Object
- ApplicationController
- ReviseAuthController
- ReviseAuth::RegistrationsController
- Defined in:
- app/controllers/revise_auth/registrations_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/revise_auth/registrations_controller.rb', line 9 def create @user = User.new(sign_up_params) if @user.save login(@user) redirect_to resolve_after_register_path else render :new, status: :unprocessable_entity end end |
#destroy ⇒ Object
30 31 32 33 34 |
# File 'app/controllers/revise_auth/registrations_controller.rb', line 30 def destroy current_user.destroy logout redirect_to root_path, status: :see_other, alert: t(".account_deleted") end |
#edit ⇒ Object
19 20 |
# File 'app/controllers/revise_auth/registrations_controller.rb', line 19 def edit end |
#new ⇒ Object
5 6 7 |
# File 'app/controllers/revise_auth/registrations_controller.rb', line 5 def new @user = User.new end |
#update ⇒ Object
22 23 24 25 26 27 28 |
# File 'app/controllers/revise_auth/registrations_controller.rb', line 22 def update if current_user.update(profile_params) redirect_to profile_path, notice: t(".account_updated") else render :edit, status: :unprocessable_entity end end |