Adds nickname and use_nickname to "my profile"

This commit is contained in:
kikito
2015-08-06 19:19:45 +02:00
parent 17a741d838
commit c4c764df38
4 changed files with 14 additions and 1 deletions

View File

@@ -17,7 +17,7 @@ class AccountController < ApplicationController
end
def account_params
params.require(:account).permit(:first_name, :last_name)
params.require(:account).permit(:first_name, :last_name, :nickname, :use_nickname)
end
end

View File

@@ -1,11 +1,20 @@
<h1><%= t("account.show.title") %></h1>
<%= form_for @account, as: :account, url: account_path do |f| %>
<%= f.label :first_name, t("account.show.first_name_label") %>
<%= f.text_field :first_name %>
<%= f.label :last_name, t("account.show.last_name_label") %>
<%= f.text_field :last_name %>
<div>
<%= f.check_box :use_nickname %>
<%= t("account.show.use_nickname_label") %>
</div>
<%= f.label :nickname, t("account.show.nickname_label") %>
<%= f.text_field :nickname %>
<%= f.submit t("account.show.save_changes_submit"), class: "button radius" %>
<% end %>

View File

@@ -60,6 +60,8 @@ en:
change_credentials_link: "Change my credentials"
first_name_label: "First Name"
last_name_label: "Last Name"
use_nickname_label: "Use nickname"
nickname_label: "Nickname"
recaptcha:
errors:
verification_failed: "The captcha verification failed"

View File

@@ -60,6 +60,8 @@ es:
change_credentials_link: "Cambiar mi contraseña"
first_name_label: "Nombre"
last_name_label: "Apellidos"
use_nickname_label: "Usar pseudónimo"
nickname_label: "Pseudónimo"
recaptcha:
errors:
verification_failed: "La verificación por captcha falló"