diff options
author | Gosha Arinich <me@goshakkk.name> | 2013-01-02 15:23:34 +0300 |
---|---|---|
committer | Gosha Arinich <me@goshakkk.name> | 2013-01-02 16:12:51 +0300 |
commit | bb932d5e9867713d0df738864b7f08e22f49b5e8 (patch) | |
tree | 94b0e111c25c5859d75d367405181e9732cc71db /actionpack | |
parent | 7e2ef18b51152ed846f0ee2888bdd63d30c6f6c4 (diff) | |
download | rails-bb932d5e9867713d0df738864b7f08e22f49b5e8.tar.gz rails-bb932d5e9867713d0df738864b7f08e22f49b5e8.tar.bz2 rails-bb932d5e9867713d0df738864b7f08e22f49b5e8.zip |
allow toggling dumps instead of just showing
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/CHANGELOG.md | 4 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index c43906612c..d0cde1b2a1 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -1,5 +1,9 @@ ## Rails 4.0.0 (unreleased) ## +* Allow to toggle dumps on error pages. + + *Gosha Arinich* + * Fix a bug in `content_tag_for` that prevents it for work without a block. *Jasl* diff --git a/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb b/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb index 55079848bd..d117dc4235 100644 --- a/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb +++ b/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb @@ -1,6 +1,6 @@ <% unless @exception.blamed_files.blank? %> <% if (hide = @exception.blamed_files.length > 8) %> - <a href="#" onclick="document.getElementById('blame_trace').style.display='block'; return false;">Show blamed files</a> + <a href="#" onclick="s = document.getElementById('blame_trace').style; s.display = s.display == 'none' ? 'block' : 'none'; return false;">Toggle blamed files</a> <% end %> <pre id="blame_trace" <%='style="display:none"' if hide %>><code><%=h @exception.describe_blame %></code></pre> <% end %> @@ -21,12 +21,12 @@ <p><b>Parameters</b>: <pre><%=h request_dump %></pre></p> <div class="details"> - <div class="summary"><a href="#" onclick="document.getElementById('session_dump').style.display='block'; return false;">Show session dump</a></div> + <div class="summary"><a href="#" onclick="s = document.getElementById('session_dump').style; s.display = s.display == 'none' ? 'block' : 'none'; return false;">Toggle session dump</a></div> <div id="session_dump" style="display:none"><p><pre><%= debug_hash @request.session %></pre></p></div> </div> <div class="details"> - <div class="summary"><a href="#" onclick="document.getElementById('env_dump').style.display='block'; return false;">Show env dump</a></div> + <div class="summary"><a href="#" onclick="s = document.getElementById('env_dump').style; s.display=='block' ? s.display = s.display == 'none' ? 'block' : 'none'; return false;">Toggle env dump</a></div> <div id="env_dump" style="display:none"><p><pre><%= debug_hash @request.env.slice(*@request.class::ENV_METHODS) %></pre></p></div> </div> |