Skip to content
This repository has been archived by the owner on Jul 28, 2018. It is now read-only.

Enable Turbolinks on a-tags after adding content over AJAX #659

Open
patricklehmann opened this issue Jan 28, 2016 · 1 comment
Open

Enable Turbolinks on a-tags after adding content over AJAX #659

patricklehmann opened this issue Jan 28, 2016 · 1 comment

Comments

@patricklehmann
Copy link

Hi guys

I'm having the following markup:

<body>
  <header id="sq-header" data-turbolinks-permanent></header>

  <section data-turbolinks-temporary>
    = yield
  </section>

And this small piece in a coffeescript file.

'use strict'

$(document).on 'ready', (event) ->
  $.get('/templates/header', ( template_data ) ->
    $('#sq-header').html(template_data)
  )

/templates/header returns a navigation with some links. Unfortunately turbolinks is not working when hitting these links. I think it's because turbolinks isn't enabled on this markup. Is there a way to re-enable it?

Thanks for your reply!

Regards, patrick

@sebastianpicklum
Copy link

Is there any reason why this piece is loaded via AJAX? Seems like an unnecessary server round-trip to me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants