diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb index b9e664f..7846429 100644 --- a/app/controllers/users/registrations_controller.rb +++ b/app/controllers/users/registrations_controller.rb @@ -2,7 +2,7 @@ class Users::RegistrationsController < Devise::RegistrationsController # before_action :configure_sign_up_params, only: [:create] - # before_action :configure_account_update_params, only: [:update] + before_action :configure_account_update_params, only: [:update] # GET /resource/sign_up # def new @@ -46,9 +46,9 @@ class Users::RegistrationsController < Devise::RegistrationsController # end # If you have extra params to permit, append them to the sanitizer. - # def configure_account_update_params - # devise_parameter_sanitizer.permit(:account_update, keys: [:attribute]) - # end + def configure_account_update_params + devise_parameter_sanitizer.permit(:account_update, keys: [:name, :title]) + end # The path used after sign up. # def after_sign_up_path_for(resource) diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index 38d95b8..2196e83 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -1,43 +1,63 @@ -

Edit <%= resource_name.to_s.humanize %>

- -<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> +
<%= render "devise/shared/error_messages", resource: resource %> - -
- <%= f.label :email %>
- <%= f.email_field :email, autofocus: true, autocomplete: "email" %> -
- - <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> -
Currently waiting confirmation for: <%= resource.unconfirmed_email %>
- <% end %> - -
- <%= f.label :password %> (leave blank if you don't want to change it)
- <%= f.password_field :password, autocomplete: "new-password" %> - <% if @minimum_password_length %> -
- <%= @minimum_password_length %> characters minimum +

+ +
+ Account Settings +
Manage your preferences
+
+

+
+ <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, class: 'ui form'}) do |f| %> + +
+ <%= f.label :full_name %> + <%= f.text_field :name, autocomplete: "name" %> +
+ +
+ <%= f.label :email %> + <%= f.email_field :email, autocomplete: "email" %> +
+ +
+ <%= f.label :title %> + <%= f.text_field :title, autocomplete: "name" %> +
+ + <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> +
Currently waiting confirmation for: <%= resource.unconfirmed_email %>
+ <% end %> + +
+ <%= f.label :password %> + <%= f.password_field :password, autocomplete: "new-password" %> +
+ +
+ <%= f.label :password_confirmation %> + <%= f.password_field :password_confirmation, autocomplete: "new-password" %> +
+ +
+ <%= f.label :current_password %> + <%= f.password_field :current_password, autocomplete: "current-password" %> +
+ +
+ <%= f.button "Save", class: 'blue ui button' %> + <%= link_to "Cancel", current_user, class: 'ui button'%> +
<% end %> + +

Delete my account

+ +

Unhappy?


+ <%= link_to "Delete my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete, class: 'negative ui button' %> +
+
-
- <%= f.label :password_confirmation %>
- <%= f.password_field :password_confirmation, autocomplete: "new-password" %> -
- -
- <%= f.label :current_password %> (we need your current password to confirm your changes)
- <%= f.password_field :current_password, autocomplete: "current-password" %> -
- -
- <%= f.submit "Update" %> -
-<% end %> - -

Cancel my account

+ -

Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %>

-<%= link_to "Back", :back %> diff --git a/app/views/layouts/_navigation.html.erb b/app/views/layouts/_navigation.html.erb index b2ba3e0..66332d8 100644 --- a/app/views/layouts/_navigation.html.erb +++ b/app/views/layouts/_navigation.html.erb @@ -6,8 +6,8 @@