diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 3e70323..da8817c 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -9,7 +9,7 @@ class UsersController < ApplicationController return render :show end session[:password] = user_params[:password] - redirect_to user_path + redirect_to user_path, notice: I18n.t("messages.password_successfully_updated") end private diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index bea6238..026e35d 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -3,8 +3,11 @@ %div.col-xs-6 - - @user.errors.full_messages.each do |e| - %div.alert.alert-danger= e + - if notice + %div.alert.alert-success= notice + - else + - @user.errors.full_messages.each do |e| + %div.alert.alert-danger= e = form_for(:user, url: user_path, method: :patch) do |f| %div.form-group diff --git a/config/locales/translation_en.yml b/config/locales/translation_en.yml index b9981f0..c13bab9 100644 --- a/config/locales/translation_en.yml +++ b/config/locales/translation_en.yml @@ -8,6 +8,7 @@ en: fluentd_stop_failed: Failed to stop fluentd fluentd_restart_failed: Failed to restart fluentd fluentd_start_stop_delay_notice: "'%{action} daemon' is accepted. That operation could take a minute for complete." + password_successfully_updated: "Your password has been changed successfully." terms: &terms name: Name diff --git a/config/locales/translation_ja.yml b/config/locales/translation_ja.yml index 577d147..65fdcf9 100644 --- a/config/locales/translation_ja.yml +++ b/config/locales/translation_ja.yml @@ -8,6 +8,7 @@ ja: fluentd_stop_failed: "%{brand}の停止に失敗しました。" fluentd_restart_failed: "%{brand}の再起動に失敗しました。" fluentd_start_stop_delay_notice: "デーモンの%{action}を受け付けました。処理が完了するまで時間がかかる場合があります。" + password_successfully_updated: "パスワードを変更しました。" terms: &terms name: アカウント名