]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/user_preference_controller.rb
Cleanup trailing whitespace
[rails.git] / app / controllers / user_preference_controller.rb
index df5f279b8de2699114e8c8b93d2a19a1f92fec2f..7d6fc8e236a1b35215084acef64a523b471a4b92 100644 (file)
@@ -26,7 +26,7 @@ class UserPreferenceController < ApplicationController
   ##
   # return the value for a single preference
   def read_one
-    pref = UserPreference.find(@user.id, params[:preference_key])
+    pref = UserPreference.find([@user.id, params[:preference_key]])
 
     render :text => pref.v.to_s, :content_type => "text/plain"
   end
@@ -62,15 +62,15 @@ class UserPreferenceController < ApplicationController
       preference.save!
     end
 
-    render :nothing => true, :content_type => "text/plain"
+    render :text => "", :content_type => "text/plain"
   end
 
   ##
   # update the value of a single preference
   def update_one
     begin
-      pref = UserPreference.find(@user.id, params[:preference_key])
-    rescue ActiveRecord::RecordNotFound 
+      pref = UserPreference.find([@user.id, params[:preference_key]])
+    rescue ActiveRecord::RecordNotFound
       pref = UserPreference.new
       pref.user = @user
       pref.k = params[:preference_key]
@@ -79,14 +79,14 @@ class UserPreferenceController < ApplicationController
     pref.v = request.raw_post.chomp
     pref.save!
 
-    render :nothing => true, :content_type => "text/plain"
+    render :text => "", :content_type => "text/plain"
   end
 
   ##
   # delete a single preference
   def delete_one
-    UserPreference.find(@user.id, params[:preference_key]).delete
+    UserPreference.find([@user.id, params[:preference_key]]).delete
 
-    render :nothing => true, :content_type => "text/plain"
+    render :text => "", :content_type => "text/plain"
   end
 end