]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api/user_preferences_controller.rb
Merge pull request #3169 from harry-wood/empty-lists
[rails.git] / app / controllers / api / user_preferences_controller.rb
index ddc5d7f430a9eff0c085bedaf40cf3a9d70a76b5..40ccfccbbc4a222a841c67f312d6665a13998a10 100644 (file)
@@ -7,12 +7,17 @@ module Api
 
     around_action :api_call_handle_error
 
+    before_action :set_request_formats
+
     ##
-    # return all the preferences as an XML document
+    # return all the preferences
     def index
       @user_preferences = current_user.preferences
 
-      render :formats => [:xml]
+      respond_to do |format|
+        format.xml
+        format.json
+      end
     end
 
     ##