turbolinks / turbolinks-classic

Classic version of Turbolinks. Now deprecated in favor of Turbolinks 5.
MIT License
3.54k stars 431 forks source link

How to load `turbolinks` in an engine #605

Closed sebastianzillessen closed 9 years ago

sebastianzillessen commented 9 years ago

Hi,

at my current project, we have a large software that is wrapped in a private gem. This is included in all customer projects to be able to have a default project which can be extended and to provide all users with the latest version.

Now I would like to include the turbolinks javascript files into that engine. Therefore I did the following:

But when I try to reload the page (after server restart) I get the following error:

Sprockets::FileNotFound at /<something>
couldn't find file 'turbolinks'
  (in /Users/sebastianzillessen/<project>/<gem-engine>/app/assets/javascripts/application.js:15)

Any ideas, what I'm doing wrong?

Thank you!

Thibaut commented 9 years ago

Try to add require 'turbolinks' in your gem's main file.

sebastianzillessen commented 9 years ago

Yeah that did it