From 34413615683677e26213263fb98f63b5aab64872 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 12 Mar 2016 20:47:22 +0100 Subject: Adding simple_form, adding profile settings, header image --- app/controllers/settings_controller.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 app/controllers/settings_controller.rb (limited to 'app/controllers/settings_controller.rb') diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb new file mode 100644 index 000000000..cb4688292 --- /dev/null +++ b/app/controllers/settings_controller.rb @@ -0,0 +1,27 @@ +class SettingsController < ApplicationController + layout 'dashboard' + + before_action :authenticate_user! + before_action :set_account + + def show + end + + def update + if @account.update(account_params) + redirect_to settings_path + else + render action: :show + end + end + + private + + def account_params + params.require(:account).permit(:display_name, :note, :avatar, :header) + end + + def set_account + @account = current_user.account + end +end -- cgit