diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb index 0fd4b4e0b8a5da64be731dd3276604b3975846a5..85f5f2338c257cf548ad70584cd3eea97df8f2a5 100644 --- a/app/controllers/users/registrations_controller.rb +++ b/app/controllers/users/registrations_controller.rb @@ -1,6 +1,7 @@ class Users::RegistrationsController < Devise::RegistrationsController prepend_before_action :set_university, only: :create before_action :configure_sign_up_params, only: :create + before_action :configure_account_update_params, only: :update protected @@ -9,8 +10,11 @@ class Users::RegistrationsController < Devise::RegistrationsController request.params[:user][:university_id] = current_university.id end - # If you have extra params to permit, append them to the sanitizer. def configure_sign_up_params devise_parameter_sanitizer.permit(:sign_up, keys: [:language_id]) end + + def configure_account_update_params + devise_parameter_sanitizer.permit(:account_update, keys: [:mobile_phone, :language_id]) + end end diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index cc11aefc3ee13e187cf9b87a1d29967319510cc1..ea86eb7467beb88a83496fbf4f204a0b1177dd79 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -10,6 +10,9 @@ <p>Currently waiting confirmation for: <%= resource.unconfirmed_email %></p> <% end %> + <%= f.input :mobile_phone %> + <%= f.association :language, include_blank: false %> + <%= f.input :password, hint: "leave it blank if you don't want to change it", required: false,