aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorGuillermo Iguaran <guilleiguaran@gmail.com>2013-01-02 07:35:53 -0800
committerGuillermo Iguaran <guilleiguaran@gmail.com>2013-01-02 07:35:53 -0800
commit6e475a04bd4bc5ae65382fa6d0454b80db3a935b (patch)
treeebdcc904ea3c13dca35a18e53caf28423a965a73 /actionpack
parentf83b6ed983dd06f367d0b9ad60debabf0c757656 (diff)
parentbb932d5e9867713d0df738864b7f08e22f49b5e8 (diff)
downloadrails-6e475a04bd4bc5ae65382fa6d0454b80db3a935b.tar.gz
rails-6e475a04bd4bc5ae65382fa6d0454b80db3a935b.tar.bz2
rails-6e475a04bd4bc5ae65382fa6d0454b80db3a935b.zip
Merge pull request #8688 from goshakkk/error-page-toggle
Allow toggling dumps on error page
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/CHANGELOG.md4
-rw-r--r--actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb6
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>