diff --git a/src/autogen/app/controllers/users_controller.rb b/src/autogen/app/controllers/users_controller.rb index 8f77ea2..e226166 100644 --- a/src/autogen/app/controllers/users_controller.rb +++ b/src/autogen/app/controllers/users_controller.rb @@ -20,7 +20,7 @@ class UsersController < ApplicationController # PATCH/PUT /user/1 or /user/1.json def update respond_to do |format| - logger.debug(account_params) + logger.debug(user_params) if @user.update() format.html { redirect_to account_url(@user), notice: "User was successfully updated." } format.json { render :show, status: :ok, location: @user } @@ -44,12 +44,12 @@ class UsersController < ApplicationController private # Use callbacks to share common setup or constraints between actions. def set_user - @user = Account.find(params[:id]) + @user = User.find(params[:id]) end # Only allow a list of trusted parameters through. def user_params - params.require(:user).permit(:name, :group) + params.require(:user).permit(:first_name,:last_name, :group) end def check_group if current_user.group != "admin" diff --git a/src/autogen/app/models/user.rb b/src/autogen/app/models/user.rb index 4954aa9..7b41f8f 100644 --- a/src/autogen/app/models/user.rb +++ b/src/autogen/app/models/user.rb @@ -34,7 +34,7 @@ class User # field :unlock_token, type: String # Only if unlock strategy is :email or :both # field :locked_at, type: Time field :group, type: String, default: "" - field :name, type: String, default: "" - + field :first_name, type: String, default: "" + field :last_name, type: String, default: "" include Mongoid::Timestamps end diff --git a/src/autogen/app/views/devise/registrations/edit.html.erb b/src/autogen/app/views/devise/registrations/edit.html.erb index 1097d30..1936794 100644 --- a/src/autogen/app/views/devise/registrations/edit.html.erb +++ b/src/autogen/app/views/devise/registrations/edit.html.erb @@ -23,6 +23,17 @@ <% end %> + +
+ <%= f.label :first_name %>
+ <%= f.text_field :first_name, autocomplete: "new-first-name", class: "input is-small" , placeholder: "New First name" %> +
+ +
+ <%= f.label :last_name %>
+ <%= f.text_field :last_name, autocomplete: "new-last-name", class: "input is-small" , placeholder: "New Last name" %> +
+
<%= f.label :password_confirmation %>
<%= f.password_field :password_confirmation, autocomplete: "new-password", class: "input is-small" , placeholder: "New password confirmation" %> diff --git a/src/autogen/app/views/devise/registrations/new.html.erb b/src/autogen/app/views/devise/registrations/new.html.erb index 90a9ccc..22975c1 100644 --- a/src/autogen/app/views/devise/registrations/new.html.erb +++ b/src/autogen/app/views/devise/registrations/new.html.erb @@ -10,6 +10,17 @@ <%= f.email_field :email, autofocus: true, autocomplete: "email", class: "input is-small" , placeholder: :email %>
+ +
+ <%= f.label :first_name %>
+ <%= f.text_field :first_name, autocomplete: "new-first-name", class: "input is-small" , placeholder: "New First name" %> +
+ +
+ <%= f.label :last_name %>
+ <%= f.text_field :last_name, autocomplete: "new-last-name", class: "input is-small" , placeholder: "New Last name" %> +
+
<%= f.label :password %> <% if @minimum_password_length %> diff --git a/src/autogen/app/views/partials/_top-menu.html.erb b/src/autogen/app/views/partials/_top-menu.html.erb index 889c57c..8f34e42 100644 --- a/src/autogen/app/views/partials/_top-menu.html.erb +++ b/src/autogen/app/views/partials/_top-menu.html.erb @@ -45,7 +45,7 @@
<% if user_signed_in? %> <% end %>