Skip to main content

Join GoRails to continue learning

Subscribe to GoRails to get access to this episode and all other pro episodes, and access to our private Slack community of Ruby and Rails devs.

Subscribe to watch

Login to your account

Turbolinks 5 Forms for Mobile

22

Episode 116 · May 2, 2016

Learn how to setup forms to work with Turbolinks iOS and Android adapters

Turbolinks Javascript Forms


Resources

Add this to your application as turbolinks-forms.js.coffee and make sure it gets required in application.js

$.rails.ajax = (options) ->
  op = $.ajax(options)

  op.done (response) ->
    unless response.substring(0, 10) == 'Turbolinks'
      Turbolinks.clearCache()
      document.documentElement.innerHTML = response
      Turbolinks.dispatch("turbolinks:load")
      window.scroll(0,0)
Transcripts

Subscribe or login to view the transcript for this episode.

Loading...

Subscribe to the newsletter

Join 24,647+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.