Class: Closure::ShowExceptions
- Inherits:
-
Object
- Object
- Closure::ShowExceptions
- Defined in:
- lib/closure/show_exceptions.rb
Overview
This is Rack middleware to show Ruby exceptions. It is automatically loaded when using Closure::Middleware. It works very much like Rack::ShowExceptions but will use the Javascript console when it can detect the request was for javascript.
If Javascript detection isn’t working because you’re not using .js.erb for the extension, add this as the first line of your script:
<% @response.headers['Content-Type'] = 'application/javascript' %>
Instance Method Summary (collapse)
- - call(env)
-
- (ShowExceptions) initialize(app)
constructor
A new instance of ShowExceptions.
Constructor Details
- (ShowExceptions) initialize(app)
A new instance of ShowExceptions
81 82 83 |
# File 'lib/closure/show_exceptions.rb', line 81 def initialize(app) @app = Html.new(Javascript.new(app)) end |
Instance Method Details
- call(env)
85 86 87 |
# File 'lib/closure/show_exceptions.rb', line 85 def call(env) @app.call(env) end |