Skip to content

Instantly share code, notes, and snippets.

@omgitsads
Forked from tjl2/error.log
Created November 15, 2011 13:29
Show Gist options
  • Save omgitsads/1367073 to your computer and use it in GitHub Desktop.
Save omgitsads/1367073 to your computer and use it in GitHub Desktop.
Examining request objects
ActionView::Template::Error (can't dump anonymous class Class):
1: <h3>Rack request env</h3>
2: <h3>Rails request object</h3>
3: <pre><%= h(@request_obj.to_yaml).gsub(" ", "&nbsp;").html_safe %></pre>
app/views/headers/index.html.erb:3:in `_app_views_headers_index_html_erb___1006215901_77896010__270781548'
class HeadersController < ApplicationController
def index
@rack_request_env = Rack::Request.new(env)
@request_obj = request
end
end
<h3>Rack request env</h3>
<pre><%= h(@rack_request_env.to_yaml).gsub(" ", "&nbsp;").html_safe %></pre>
<h3>Rails request object</h3>
<pre><%= h(@request_obj.to_yaml).gsub(" ", "&nbsp;").html_safe %></pre>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment