Skip to content

Instantly share code, notes, and snippets.

@ntreadway
Created April 27, 2012 22:46
Show Gist options
  • Save ntreadway/2514032 to your computer and use it in GitHub Desktop.
Save ntreadway/2514032 to your computer and use it in GitHub Desktop.
Jquery page exception error for rails
<% if Rails.env.development? %>
@onLoadFailed = (event, data) ->
text = data.xhr.responseText
newHtml = text.split(/<\/?html[^>]*>/g)[1]
$("html").html newHtml
$(document).on "pageloadfailed", onLoadFailed
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment