Fixed #323 Allow users to select a language in settings (GRN-17) (#324)

* <Added ui for language setting and migration>

* <Option to choose languages added>

* <Fixed code style>

* <Added Rspec tests>

* <sync db>

* <Sync db>

* <Generalized language settings>

* <Fixed flash message>

* Fixed las issue with i18n fallback

* <Modified fallback config>

* <Fixed code style>
This commit is contained in:
John Ma
2018-12-06 16:00:22 -05:00
committed by Jesus Federico
parent 895af7494e
commit b3f37cd3b3
11 changed files with 89 additions and 8 deletions

View File

@ -93,6 +93,7 @@ class UsersController < ApplicationController
@user.update_attributes(email_verified: false)
redirect_to edit_user_path(@user), notice: I18n.t("info_update_success")
elsif @user.update_attributes(user_params)
update_locale(@user)
redirect_to edit_user_path(@user), notice: I18n.t("info_update_success")
else
render :edit, params: { settings: params[:settings] }
@ -171,6 +172,6 @@ class UsersController < ApplicationController
def user_params
params.require(:user).permit(:name, :email, :image, :password, :password_confirmation,
:new_password, :provider, :accepted_terms)
:new_password, :provider, :accepted_terms, :language)
end
end