Add an explicit "default editor" option to the user settings
[rails.git] / app / controllers / user_controller.rb
index d73d38a..6935af3 100644 (file)
@@ -109,7 +109,11 @@ class UserController < ApplicationController
       @user.home_lat = params[:user][:home_lat]
       @user.home_lon = params[:user][:home_lon]
 
-      @user.preferred_editor = params[:user][:preferred_editor]
+      if params[:user][:preferred_editor] == "default"
+        @user.preferred_editor = nil
+      else
+        @user.preferred_editor = params[:user][:preferred_editor]
+      end
 
       if @user.save
         set_locale