add personalization settings

This commit is contained in:
Alex Turchyn
2023-08-16 22:57:59 +03:00
parent 545b18086a
commit 187b354605
34 changed files with 244 additions and 60 deletions
@@ -0,0 +1,20 @@
# frozen_string_literal: true
class PersonalizationSettingsController < ApplicationController
def show; end
def create
account_config =
current_account.account_configs.find_or_initialize_by(key: encrypted_config_params[:key])
account_config.update!(encrypted_config_params)
redirect_back(fallback_location: settings_personalization_path, notice: 'Settings have been saved.')
end
private
def encrypted_config_params
params.require(:account_config).permit!
end
end