learn-rails icon indicating copy to clipboard operation
learn-rails copied to clipboard

create methods in controllers cause root to load multiple times.

Open serodriguez68 opened this issue 9 years ago • 1 comments

Hi Daniel!

I've followed the book closely and the app is working great (https://sr-learn-rails.herokuapp.com/).

When I installed the analytics feature through segment.io (Ch. 26) I noticed a strange behavior on my segment debugger dashboard: Whenever a form event is triggered (sign up or contact request) the user is redirected to the root (as intended) but the page is loaded 3 times. The same behavior happens when you load the app using the URL (not the nav links).

I attached a screenshot of my segment dashboard to give you some context.

Any idea why this is happening?

Note: The console.log line you wrote in the segmentio.js file is also printed 2 times when an event is triggered.

image

serodriguez68 avatar Mar 03 '15 03:03 serodriguez68

I was able to reproduce this with @serodriguez68's repo serodriguez68/learn-rails and it looks like a Turbolinks issue.

Maybe we should close this, @DanielKehoe? This issue has been around for so long, and Turbolinks has been rewritten from scratch since then. ;) This issue does not happen in the latest version of this repo.

nithinbekal avatar Apr 01 '17 07:04 nithinbekal