What is the JS architectural philosophy for Rails turbolinks?

72 views Asked by At

TL really speeds the up apps when they're vanilla and basic but once you venture off the beaten path it's quite tricky to get the JS to play nice with eachother.

What is the general JS controller/view philosophy when running Turbolinks? I'm dealing with lots of double initialization and dangling events, probably because of some $(document) binds.

Where is the appropriate bind location for JS handlers? Since the DOM doesn't get unloaded or is cached, this can be dangerous.

How do you initialize page-specific JS? Do you put them on turoblinks:load events?

Haven't had much luck in finding good design technique documentation.

Thanks for the help all.

0

There are 0 answers