Class: ReviseAuth::RegistrationsController
Instance Method Summary
collapse
#revise_auth_controller?
#authenticate_user, #authenticate_user!, #authenticated_user_from_session, #current_user, #login, #logout, #reset_session, #user_signed_in?
Instance Method Details
#create ⇒ Object
8
9
10
11
12
13
14
15
16
17
|
# File 'app/controllers/revise_auth/registrations_controller.rb', line 8
def create
@user = User.new(sign_up_params)
if @user.save
login(@user)
current_user.api_tokens.first_or_create(name: ApiToken::APP_NAME)
redirect_to root_path
else
render :new, status: :unprocessable_entity
end
end
|
#delete ⇒ Object
30
31
32
33
34
|
# File 'app/controllers/revise_auth/registrations_controller.rb', line 30
def delete
current_user.destroy
logout
redirect_to root_path, status: :see_other, alert: I18n.t("revise_auth.account_deleted")
end
|
#edit ⇒ Object
19
20
|
# File 'app/controllers/revise_auth/registrations_controller.rb', line 19
def edit
end
|
#new ⇒ Object
4
5
6
|
# File 'app/controllers/revise_auth/registrations_controller.rb', line 4
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: I18n.t("revise_auth.account_updated")
else
render :edit, status: :unprocessable_entity
end
end
|