Add an explicit "default editor" option to the user settings
[rails.git] / app / controllers / user_controller.rb
index d73d38a17f9ee5da31669feff665fe522c1f1602..6935af3bca5f3508fa7d2222a2f142975ebdc5b8 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