Ask A Question

Notifications

You’re not receiving notifications from this thread.

A series on Turbolinks 5

Marek Prihoda asked in Site Feedback

Reading through the Turbolinks 5 documentation, there are mentions of several use cases, like eg. in the Making Transformations Idempotent sections (but there are more). It would be great if you could make a series of screncasts on actual uses of Turbolinks, including covering all the edge cases and gotchas.

IMHO, Turbolinks 5 have a potential to widely used, especially for companies that do not want to invest into frontend js frameworks (or are not persuaded that these frontend js frameworks are the way to go), so such a series would be really, really appreciated. At the same time, it looks like there is not enough awareness about Turbolinks, people just don't really know what a true gem Turbolinks are.

The series could start from the very beginning, and then go with the more advanced topics, like caching, the idempotency, etc. It seems like there is a lot to cover. Then the series could continue with the Android/iOS adapters.

Reply

Marek, this would be a killer series to make. I would love to do it. So far, I've been using Turbolinks 5 for a few things but of course have also gotten caught by some of the gotchas so I still need to figure out some solutions to various things so I have a good idea of what all the gotchas are and what decent solutions should be.

Maybe we can use this thread to start keeping a list of topics to cover!

To start:
One of my biggest issues with Turbolinks has been that Chrome doesn't respect clearing the cache on a login of a page. So GoRails for example, I used to use root as the homepage, you would login, and I would replace root's contents with your dashboard. Chrome has a bug in it where it doesn't clear the cache for root until you do an actual browser refresh. The solution I had was to move your dashboard to /dashboard to avoid the cache problems there.

Reply

Chris, this seems to be a very clear explanation of idempotent transformatons: https://www.crossplatform.net/rails/article/should-you-disable-turbolinks/idempotent-transformation/

Reply

I would love to see a series on Turbolinks 5! I want to gain a good understanding of it so I can use it to its full potential so as suggested by Marek a series covering the basics, advanced topics and using the native android/ios adaptors would be awesome!

I'm working on a new rails 5 app trying to add google places autocomplete address form on a single page basis as it will only be used occasionally and I don't want to go loading javascript unnecessarily.

I've read through the documentation but am having no luck getting this going.

I've also posted on stackoverflow but no responses as of yet, so any help would be greatly appreciated.

**update

Resolve the issue I was having. The reason it wasn't working for me was because in layouts/application.html.erb I had:

<%= javascript_include_tag "application", 'data-turbolinks-track' => true %>

when it should be:

<%= javascript_include_tag "application", 'data-turbolinks-track': 'reload' %>

Now I just have to work out how to make this script idempotent.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,946+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.