when you move this code out, we can put it in a .js.erb file so that we can wrap the debug part in a conditional, so that it doesn't get run on production