Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Gem does not work #62

Open
ivanovaleksey opened this issue Jul 17, 2016 · 8 comments
Open

Gem does not work #62

ivanovaleksey opened this issue Jul 17, 2016 · 8 comments

Comments

@ivanovaleksey
Copy link

Hi!
I found this gem and thought it would be nice to use in my project.
But unfortunately it does not work for me.

Here is my application.js

//= require jquery
//= require jquery.turbolinks
//= require jquery_ujs

//= require ...
//= require ...

//= require turbolinks

I have

rails (4.2.6)
jquery-rails (4.1.1)
jquery-turbolinks (2.1.0)
turbolinks (5.0.0)

Am I doing something wrong?
Thank you.

@ivanovaleksey ivanovaleksey changed the title Gem not working Gem does not work Jul 17, 2016
@ivanovaleksey
Copy link
Author

ivanovaleksey commented Jul 17, 2016

Seems like the problem with turbolinks gem version.
It should be < 5 since your gem code is using page:load event while turbolinks 5 is using turbolinks:load, shouldn't it?

I edit turbolinks version in my Gemfile like
gem 'turbolinks', '< 5'
and it seems now like everything is working fine.

Maybe you need to update version in turbolinks dependency in jquery-turbolinks.gemspec?

@rstacruz
Copy link
Collaborator

@kossnocorp it's time to deprecate this gem :(

@ivanovaleksey
Copy link
Author

Sorry guys. I didn't see issue #61 (I wonder how, it is on the top place).

@mahendhar9
Copy link

mahendhar9 commented Jul 28, 2016

Meanwhile, try this
$(document).on('turbolinks:load', function() {
...your javascript goes here...
});

@1v
Copy link

1v commented Jul 28, 2016

Just add https://github.com/turbolinks/turbolinks/blob/55af148d880a3f80654a3a4cde9c8c41dadac861/src/turbolinks/compatibility.coffee to your app and all works.

@ivanovaleksey
Copy link
Author

Thanks for proposed solutions.
Now I just use turbolinks 2.5.3. This gem works fine with the 2.5.3.

@davidchappy
Copy link

Thank you. Reverting to Turbolinks 2.5.3 seems to work for me.

@ivanovaleksey
Copy link
Author

ivanovaleksey commented Apr 12, 2017

Guys may I close the issue?

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

5 participants