Parent

Methods

Class Index [+]

Quicksearch

ActionDispatch::PublicExceptions

A simple Rack application that renders exceptions in the given public path.

Attributes

public_path[RW]

Public Class Methods

new(public_path) click to toggle source
   # File lib/action_dispatch/middleware/public_exceptions.rb, line 6
6:     def initialize(public_path)
7:       @public_path = public_path
8:     end

Public Instance Methods

call(env) click to toggle source
    # File lib/action_dispatch/middleware/public_exceptions.rb, line 10
10:     def call(env)
11:       status      = env["PATH_INFO"][1..1]
12:       locale_path = "#{public_path}/#{status}.#{I18n.locale}.html" if I18n.locale
13:       path        = "#{public_path}/#{status}.html"
14: 
15:       if locale_path && File.exist?(locale_path)
16:         render(status, File.read(locale_path))
17:       elsif File.exist?(path)
18:         render(status, File.read(path))
19:       else
20:         [404, { "X-Cascade" => "pass" }, []]
21:       end
22:     end

Private Instance Methods

render(status, body) click to toggle source
    # File lib/action_dispatch/middleware/public_exceptions.rb, line 26
26:     def render(status, body)
27:       [status, {'Content-Type' => "text/html; charset=#{Response.default_charset}", 'Content-Length' => body.bytesize.to_s}, [body]]
28:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.