mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-03-20 12:39:59 +01:00
Add translations for UserController#update(_profile)
This commit is contained in:
parent
3ee847258a
commit
64601e7e8a
1 changed files with 6 additions and 6 deletions
|
@ -31,12 +31,12 @@ class UserController < ApplicationController
|
||||||
user_attributes = params.require(:user).permit(:show_foreign_themes, :profile_picture_x, :profile_picture_y, :profile_picture_w, :profile_picture_h,
|
user_attributes = params.require(:user).permit(:show_foreign_themes, :profile_picture_x, :profile_picture_y, :profile_picture_w, :profile_picture_h,
|
||||||
:profile_header_x, :profile_header_y, :profile_header_w, :profile_header_h, :profile_picture, :profile_header)
|
:profile_header_x, :profile_header_y, :profile_header_w, :profile_header_h, :profile_picture, :profile_header)
|
||||||
if current_user.update(user_attributes)
|
if current_user.update(user_attributes)
|
||||||
text = t('flash.user.update.text')
|
text = t(".success")
|
||||||
text += t('flash.user.update.avatar') if user_attributes[:profile_picture]
|
text += t(".notice.profile_picture") if user_attributes[:profile_picture]
|
||||||
text += t('flash.user.update.header') if user_attributes[:profile_header]
|
text += t(".notice.profile_header") if user_attributes[:profile_header]
|
||||||
flash[:success] = text
|
flash[:success] = text
|
||||||
else
|
else
|
||||||
flash[:error] = t('flash.user.update.error')
|
flash[:error] = t(".error")
|
||||||
end
|
end
|
||||||
redirect_to edit_user_profile_path
|
redirect_to edit_user_profile_path
|
||||||
end
|
end
|
||||||
|
@ -45,9 +45,9 @@ class UserController < ApplicationController
|
||||||
profile_attributes = params.require(:profile).permit(:display_name, :motivation_header, :website, :location, :description)
|
profile_attributes = params.require(:profile).permit(:display_name, :motivation_header, :website, :location, :description)
|
||||||
|
|
||||||
if current_user.profile.update(profile_attributes)
|
if current_user.profile.update(profile_attributes)
|
||||||
flash[:success] = t('flash.user.update.text')
|
flash[:success] = t(".success")
|
||||||
else
|
else
|
||||||
flash[:error] = t('flash.user.update.error')
|
flash[:error] = t(".error")
|
||||||
end
|
end
|
||||||
redirect_to edit_user_profile_path
|
redirect_to edit_user_profile_path
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue