But, I’m not sure what to do with the javascript in this situation? Do I add it to the application.js manifest or do I add the requirements in the application.html?
But, I'm not sure what to do with the javascript in this situation? Do I add it to the application.js manifest or do I add the requirements in the application.html?
Reading the Usage section of the README, it appears that all you need to do is to add this file to your vendor/assets/javascripts folder, add a reference to this script into your application.js manifest, then add the data-hover="dropdown" attribute either in place of data-toggle="dropdown" or alongside it (so both events cause the dropdown to appear).
If you're adding this to your link with the normal Rails view helpers, then you already have
Ok, I got it working. For some odd reason I couldn’t paste that hover javascript file into my javascript folder.
So, I created a new javascript file (using rubymine) and then pasted the actual code into it and saving it with the same name.
I don’t know if that’s a permissions problem, but it put the file in the root folder of my app (which I’ve deleted now).
Check the console without the plugin to see if you get any turbo links
errors, if you don't get any error proceed with integrating the plugin with
your new knowledge from the Readme document.
If it's not working, then check the console again, if you get any new
errors you are probably missing something and need to fix those js errors
(make sure you check the gem dependencies as well).
ok, I just tried $('.dropdown-toggle').dropdownHover(options); and I get ...
VM155:1 Uncaught ReferenceError: options is not defined
at <anonymous>:1:37
Yes, that's true because I gave you the example from the Readme, you need
to customise it for your code.
That's a signal that you are not reloading something via TurboLinks that you expect to be there. When a full page reload makes it work again, that means that something JS related in the page needs to observe the event 'turbolinks:load' rather than just the page:load.