summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-06-05 14:00:21 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-06-13 17:58:15 -0400
commit821fc4b03479a193b055c91b8a655d226bc46c17 (patch)
treea768f6c4cdd039261194bbc36a40b31e61c9934f /app/controllers
parent0b3c97422136683357cdb4433a5ef0aa8858c18d (diff)
downloadgitlab-ce-821fc4b03479a193b055c91b8a655d226bc46c17.tar.gz
Add Profiles::PreferencesController
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/profiles/preferences_controller.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/app/controllers/profiles/preferences_controller.rb b/app/controllers/profiles/preferences_controller.rb
new file mode 100644
index 00000000000..897e6fe074d
--- /dev/null
+++ b/app/controllers/profiles/preferences_controller.rb
@@ -0,0 +1,29 @@
+class Profiles::PreferencesController < Profiles::ApplicationController
+ before_action :user
+
+ def show
+ end
+
+ def update
+ if @user.update_attributes(preferences_params)
+ flash[:notice] = 'Preferences saved.'
+ else
+ # TODO (rspeicher): There's no validation on these values, so can it fail?
+ end
+
+ respond_to do |format|
+ format.html { redirect_to profile_preferences_path }
+ format.js
+ end
+ end
+
+ private
+
+ def user
+ @user = current_user
+ end
+
+ def preferences_params
+ params.require(:user).permit(:color_scheme_id, :theme_id)
+ end
+end