]> git.openstreetmap.org Git - rails.git/commitdiff
The render method needs to be last, otherwise the error header won't get set. Needs...
authorShaun McDonald <shaun@shaunmcdonald.me.uk>
Thu, 23 Apr 2009 21:03:59 +0000 (21:03 +0000)
committerShaun McDonald <shaun@shaunmcdonald.me.uk>
Thu, 23 Apr 2009 21:03:59 +0000 (21:03 +0000)
app/controllers/application.rb

index bfd2e9c546e852dcabad7f11ee2af4694a3df373..3d8a028104e93e9540cf66d868be561bbda788cf 100644 (file)
@@ -96,9 +96,9 @@ class ApplicationController < ActionController::Base
   #  phrase from that, we can also put the error message into the status
   #  message. For now, rails won't let us)
   def report_error(message)
-    render :text => message, :status => :bad_request
     # Todo: some sort of escaping of problem characters in the message
     response.headers['Error'] = message
+    render :text => message, :status => :bad_request
   end
 
 private