Class: Lato::AccountController
Instance Method Summary
collapse
#switch_locale
#lato_index_collection
Methods included from Layoutable
#active_navbar, #active_sidebar, #hide_sidebar, #show_sidebar
#authenticate_session, #limit_requests, #not_authenticate_session, #session_create, #session_destroy
Instance Method Details
#destroy_action ⇒ Object
44
45
46
47
48
49
50
51
52
53
54
55
56
|
# File 'app/controllers/lato/account_controller.rb', line 44
def destroy_action
respond_to do |format|
if @session.user.destroy_with_confirmation(params.require(:user).permit(:email_confirmation))
session_destroy
format.html { redirect_to lato.root_path }
format.json { render json: {} }
else
format.html { render :index, status: :unprocessable_entity }
format.json { render json: @session.user.errors, status: :unprocessable_entity }
end
end
end
|
#index ⇒ Object
6
|
# File 'app/controllers/lato/account_controller.rb', line 6
def index; end
|
#request_verify_email_action ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
|
# File 'app/controllers/lato/account_controller.rb', line 20
def request_verify_email_action
respond_to do |format|
if @session.user.request_verify_email
format.html { redirect_to lato.account_path, notice: I18n.t('lato.account_controller.request_verify_email_action_notice') }
format.json { render json: @session.user }
else
format.html { render :index, status: :unprocessable_entity }
format.json { render json: @session.user.errors, status: :unprocessable_entity }
end
end
end
|
#update_accepted_privacy_policy_version_action ⇒ Object
58
59
60
61
62
63
64
65
66
67
68
|
# File 'app/controllers/lato/account_controller.rb', line 58
def update_accepted_privacy_policy_version_action
respond_to do |format|
if @session.user.update_accepted_privacy_policy_version(params.require(:user).permit(:confirm))
format.html { redirect_to lato.account_path }
format.json { render json: @session.user }
else
format.html { render :index, status: :unprocessable_entity }
format.json { render json: @session.user.errors, status: :unprocessable_entity }
end
end
end
|
#update_accepted_terms_and_conditions_version_action ⇒ Object
70
71
72
73
74
75
76
77
78
79
80
|
# File 'app/controllers/lato/account_controller.rb', line 70
def update_accepted_terms_and_conditions_version_action
respond_to do |format|
if @session.user.update_accepted_terms_and_conditions_version(params.require(:user).permit(:confirm))
format.html { redirect_to lato.account_path }
format.json { render json: @session.user }
else
format.html { render :index, status: :unprocessable_entity }
format.json { render json: @session.user.errors, status: :unprocessable_entity }
end
end
end
|
#update_password_action ⇒ Object
32
33
34
35
36
37
38
39
40
41
42
|
# File 'app/controllers/lato/account_controller.rb', line 32
def update_password_action
respond_to do |format|
if @session.user.update(params.require(:user).permit(:password, :password_confirmation))
format.html { redirect_to lato.account_path, notice: I18n.t('lato.account_controller.update_password_action_notice') }
format.json { render json: @session.user }
else
format.html { render :index, status: :unprocessable_entity }
format.json { render json: @session.user.errors, status: :unprocessable_entity }
end
end
end
|
#update_user_action ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
|
# File 'app/controllers/lato/account_controller.rb', line 8
def update_user_action
respond_to do |format|
if @session.user.update(params.require(:user).permit(:first_name, :last_name, :email))
format.html { redirect_to lato.account_path, notice: I18n.t('lato.account_controller.update_user_action_notice') }
format.json { render json: @session.user }
else
format.html { render :index, status: :unprocessable_entity }
format.json { render json: @session.user.errors, status: :unprocessable_entity }
end
end
end
|