diff --git a/app/controllers/profile_controller.rb b/app/controllers/profile_controller.rb new file mode 100644 index 00000000..b7f73c50 --- /dev/null +++ b/app/controllers/profile_controller.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class ProfileController < ApplicationController + def index + @user = current_user + end + + def update + @user = current_user + + if @user.update(user_params) + redirect_to settings_profile_path, notice: 'Profile updated' + else + render :index + end + end + + private + + def user_params + params.require(:user).permit(:first_name, :last_name) + end +end diff --git a/app/views/email_settings/index.html.erb b/app/views/email_settings/index.html.erb index e0cd1fcc..3ac81552 100644 --- a/app/views/email_settings/index.html.erb +++ b/app/views/email_settings/index.html.erb @@ -1,48 +1,43 @@ -
- Configure your to send emails (TODO) -
- <% value = @encrypted_config.value || {} %> - <%= form_for @encrypted_config, url: settings_email_index_path, method: :post, html: { autocomplete: 'off', class: 'space-y-4' } do |f| %> - <%= f.fields_for :value do |ff| %> -+ Configure your to send emails (TODO) +
+ <% value = @encrypted_config.value || {} %> + <%= form_for @encrypted_config, url: settings_email_index_path, method: :post, html: { autocomplete: 'off', class: 'space-y-4' } do |f| %> + <%= f.fields_for :value do |ff| %> +