about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-03-12 20:47:22 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-03-12 20:47:22 +0100
commit34413615683677e26213263fb98f63b5aab64872 (patch)
tree7e682e8709ecfd5347316ea39240789548795606 /app/controllers
parent1aa477ac2f0e9195497899691bb5cc16a7034c01 (diff)
Adding simple_form, adding profile settings, header image
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/settings_controller.rb27
1 files changed, 27 insertions, 0 deletions
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