aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2012-06-14 21:58:05 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2012-06-14 21:58:05 -0300
commitc1b1956a15d3d38d0a4504e168bb69638d71e536 (patch)
tree032f3a84115ee222645d17dea8b42fe0f54a5335 /actionpack
parent9611d561edc9f816b9bf035730d6aa68b0356ab5 (diff)
downloadrails-c1b1956a15d3d38d0a4504e168bb69638d71e536.tar.gz
rails-c1b1956a15d3d38d0a4504e168bb69638d71e536.tar.bz2
rails-c1b1956a15d3d38d0a4504e168bb69638d71e536.zip
Use status, content_type, body method signature for render too
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/middleware/public_exceptions.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/public_exceptions.rb b/actionpack/lib/action_dispatch/middleware/public_exceptions.rb
index 633604c423..53bedaa40a 100644
--- a/actionpack/lib/action_dispatch/middleware/public_exceptions.rb
+++ b/actionpack/lib/action_dispatch/middleware/public_exceptions.rb
@@ -1,5 +1,4 @@
module ActionDispatch
- # A simple Rack application that renders exceptions in the given public path.
class PublicExceptions
attr_accessor :public_path
@@ -12,15 +11,15 @@ module ActionDispatch
status = env["PATH_INFO"][1..-1]
request = ActionDispatch::Request.new(env)
content_type = request.formats.first
- format = content_type && "to_#{content_type.to_sym}"
body = { :status => status, :error => exception.message }
- render(status, body, format, content_type)
+ render(status, content_type, body)
end
private
- def render(status, body, format, content_type)
+ def render(status, content_type, body)
+ format = content_type && "to_#{content_type.to_sym}"
if format && body.respond_to?(format)
render_format(status, content_type, body.public_send(format))
else