X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c809f79912a3b998ddf3a21973582254db564183..dd81b09ebaae296f5dc29cf991944b38e3c80c8c:/app/controllers/user_preference_controller.rb diff --git a/app/controllers/user_preference_controller.rb b/app/controllers/user_preference_controller.rb index df5f279b8..a3face30d 100644 --- a/app/controllers/user_preference_controller.rb +++ b/app/controllers/user_preference_controller.rb @@ -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,14 +62,14 @@ 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]) + pref = UserPreference.find([@user.id, params[:preference_key]]) rescue ActiveRecord::RecordNotFound pref = UserPreference.new pref.user = @user @@ -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