Permalink
Browse files

Use status, content_type, body method signature for render too

  • Loading branch information...
1 parent 9611d56 commit c1b1956a15d3d38d0a4504e168bb69638d71e536 @spastorino spastorino committed Jun 15, 2012
Showing with 3 additions and 4 deletions.
  1. +3 −4 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 @@ def call(env)
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

0 comments on commit c1b1956

Please sign in to comment.