+ ##
+ # update the value of a single preference
+ def update_one
+ begin
+ pref = UserPreference.find(@user.id, params[:preference_key])
+ rescue ActiveRecord::RecordNotFound
+ pref = UserPreference.new
+ pref.user = @user
+ pref.k = params[:preference_key]
+ end
+
+ pref.v = request.raw_post.chomp
+ pref.save!
+
+ render :text => "", :content_type => "text/plain"
+ end
+
+ ##
+ # delete a single preference
+ def delete_one
+ UserPreference.find(@user.id, params[:preference_key]).delete
+
+ render :text => "", :content_type => "text/plain"
+ end