I was using gon with my project, but decided I didn’t want it anymore.
With gon, application.html.erb looks like this:
<!DOCTYPE html>
<html>
<head>
<title><%= full_title(yield :title) %></title>
<%= include_gon %>
<%= render 'layouts/stylesheets' %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tag %>
<!-- Begin Analytics -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-29558757-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<!-- End Analytics -->
<!-- Begin favicon.ico -->
<%= favicon_link_tag %>
<!-- End facicon.ico -->
</head>
<body>
<% unless @home %>
<%= render 'layouts/header' %>
<% end %>
<div id="content">
<p style="color: black"><%= notice %></p>
<p style="color: red"><%= alert %></p>
<%= yield %>
</div>
<div style="color: black"><%= debug(params) if Rails.env.development? %> </div>
</body>
</html>
Without gon, application.html.erb looks like this:
<!DOCTYPE html>
<html>
<head>
<title><%= full_title(yield :title) %></title>
<%= render 'layouts/stylesheets' %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tag %>
<!-- Begin Analytics -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-29558757-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<!-- End Analytics -->
<!-- Begin favicon.ico -->
<%= favicon_link_tag %>
<!-- End facicon.ico -->
</head>
<body>
<% unless @home %>
<%= render 'layouts/header' %>
<% end %>
<div id="content">
<p style="color: black"><%= notice %></p>
<p style="color: red"><%= alert %></p>
<%= yield %>
</div>
<div style="color: black"><%= debug(params) if Rails.env.development? %> </div>
</body>
</html>
All I did was remove the <%= include_gon %> line. When I do this, however, none of my remote forms work anymore. The callbacks just don’t get called. If I put the <%= include_gon %> line back in, the callbacks work again.
Is there a process to remove gon from a project?
I had a reference to gon in a buried JS file. For some reason, I wasn’t getting an error about gon being undefined, and that error was silently killing the rest of the js interpretation.
Also, I was using slickgrid. One of the included files with slickgrid seems to be somehow catching the focus of the ajax callbacks