Skip to content

Commit

Permalink
Naive fix to allow using Better Errors with Turbolinks. Closes #91.
Browse files Browse the repository at this point in the history
  • Loading branch information
rstacruz committed Jan 17, 2013
1 parent fe77459 commit 6119576
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/better_errors/templates/main.erb
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,12 @@
</style>
</head>
<body>
<script>
// If Rails's Turbolinks is used, the Better Errors page is probably
// rendered in the host app's layout. Redirect before the page is rendered
if (window.Turbolinks) window.location.href = '/__better_errors';
</script>

<div class='top'>
<header class="exception">
<h2><strong><%= exception.class %></strong> <span>at <%= request_path %></span></h2>
Expand Down Expand Up @@ -703,6 +709,7 @@
</body>
<script>
(function() {

var OID = <%== object_id.to_s.inspect %>;

var previousFrame = null;
Expand Down

0 comments on commit 6119576

Please sign in to comment.