]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/user_preference_controller.rb
Use named constants for HTTP response codes.
[rails.git] / app / controllers / user_preference_controller.rb
index 7f841b72b79d244e82c5e2899fccb8e37179d2c0..b22c522402e581cc54a1572cd6bee2757aaff42e 100644 (file)
@@ -32,7 +32,7 @@ class UserPreferenceController < ApplicationController
         pref = UserPreference.new
         
         unless keyhash[pt['k']].nil? # already have that key
         pref = UserPreference.new
         
         unless keyhash[pt['k']].nil? # already have that key
-          render :text => 'OH NOES! CAN HAS UNIQUE KEYS?', :status => 406
+          render :text => 'OH NOES! CAN HAS UNIQUE KEYS?', :status => :not_acceptable
           return
         end
         
           return
         end
         
@@ -45,7 +45,7 @@ class UserPreferenceController < ApplicationController
       end
 
       if prefs.size > 150
       end
 
       if prefs.size > 150
-        render :text => 'Too many preferences', :status => 413
+        render :text => 'Too many preferences', :status => :request_entity_too_large
         return
       end
 
         return
       end
 
@@ -58,7 +58,7 @@ class UserPreferenceController < ApplicationController
       end
 
     rescue Exception => ex
       end
 
     rescue Exception => ex
-      render :text => 'OH NOES! FAIL!: ' + ex.to_s, :status => 500
+      render :text => 'OH NOES! FAIL!: ' + ex.to_s, :status => :internal_server_error
       return
     end
 
       return
     end