From f1ef257c9724d5261ddfe2028ebeb1f7631315cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Mon, 9 Jan 2023 14:41:16 +0800 Subject: [PATCH] Rename settings page --- app/controllers/account_controller.rb | 7 +++++++ app/controllers/security_controller.rb | 7 ------- .../{security_controller.rb => account_controller.rb} | 2 +- app/views/settings/{security => account}/index.html.erb | 0 app/views/shared/_sidenav_settings.html.erb | 4 ++-- config/routes.rb | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) create mode 100644 app/controllers/account_controller.rb delete mode 100644 app/controllers/security_controller.rb rename app/controllers/settings/{security_controller.rb => account_controller.rb} (81%) rename app/views/settings/{security => account}/index.html.erb (100%) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb new file mode 100644 index 0000000..182a5f8 --- /dev/null +++ b/app/controllers/account_controller.rb @@ -0,0 +1,7 @@ +class AccountController < ApplicationController + before_action :require_user_signed_in + + def index + @current_section = :account + end +end diff --git a/app/controllers/security_controller.rb b/app/controllers/security_controller.rb deleted file mode 100644 index 358cd0d..0000000 --- a/app/controllers/security_controller.rb +++ /dev/null @@ -1,7 +0,0 @@ -class SecurityController < ApplicationController - before_action :require_user_signed_in - - def index - @current_section = :security - end -end diff --git a/app/controllers/settings/security_controller.rb b/app/controllers/settings/account_controller.rb similarity index 81% rename from app/controllers/settings/security_controller.rb rename to app/controllers/settings/account_controller.rb index 2ae0bb7..385a9ff 100644 --- a/app/controllers/settings/security_controller.rb +++ b/app/controllers/settings/account_controller.rb @@ -1,4 +1,4 @@ -class Settings::SecurityController < SettingsController +class Settings::AccountController < SettingsController def index end diff --git a/app/views/settings/security/index.html.erb b/app/views/settings/account/index.html.erb similarity index 100% rename from app/views/settings/security/index.html.erb rename to app/views/settings/account/index.html.erb diff --git a/app/views/shared/_sidenav_settings.html.erb b/app/views/shared/_sidenav_settings.html.erb index ff32ae8..25d345a 100644 --- a/app/views/shared/_sidenav_settings.html.erb +++ b/app/views/shared/_sidenav_settings.html.erb @@ -3,8 +3,8 @@ active: current_page?(settings_profile_path) ) %> <%= render SidenavLinkComponent.new( - name: "Security", path: settings_security_path, icon: "key", - active: current_page?(settings_security_path) + name: "Account", path: settings_account_path, icon: "key", + active: current_page?(settings_account_path) ) %> <%= render SidenavLinkComponent.new( name: "Security", path: "#", icon: "shield", disabled: true diff --git a/config/routes.rb b/config/routes.rb index 222408b..70662af 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -12,8 +12,8 @@ Rails.application.routes.draw do namespace :settings do get 'profile', to: 'profile#index' - get 'security', to: 'security#index' - post 'reset_password', to: 'security#reset_password' + get 'account', to: 'account#index' + post 'reset_password', to: 'account#reset_password' end namespace :contributions do