0

I'm trying to learn Ruby on Rails and understand the asset pipeline. I figured a good way to do this would be to create my website in Rails and learn with it. However, upon implementing my JS, it seems to add it to the file, but do nothing with it as the scripts aren't working (or some of them...)

I have just set it up on Heroku as I assume that's the easiest way for you to see the code? https://secret-citadel-76066.herokuapp.com/

I haven't yet called owl carousel so I'm sure that would fix the main sections as they're all owl carousels, but what's not working is the navigation and also a scroll to next section should scroll in, and at the bottom a scroll to top should scroll in.

However, somethings work - such as the scrollbar (nicebar).

Any suggestions?

EDIT:

//= require jquery
//= require jquery_ujs
//= require jquery.easing.1.3
//= require detectmobilebrowser
//= require isotope.pkgd.min
//= require wow.min
//= require waypoints
//= require jquery.counterup.min
//= require jquery.nicescroll.min
//= require gmaps
//= require materialize-sprockets
//= require common
//= require stuart-green
//= require turbolinks

note: I deleted the tree because I want to have more control over what loads when

Stuart Pontins
  • 285
  • 4
  • 14
  • 1
    The easiest way for us to see the code is for you to copy the relevant parts into your question. It's also the preferred way. – Mike Cluck Mar 07 '16 at 21:13
  • Please include the relevant code. – ruby_newbie Mar 07 '16 at 21:14
  • But if I'm honest I'm not sure what's relevant? I don't have any relevant errors (only jquery error is one that I haven't added) However, I'll add my application.js I suppose? – Stuart Pontins Mar 07 '16 at 21:19
  • 1
    Please post the javascript that isn't working as you expect and explain what you expect it to do versus how it's actually performing. – toddmetheny Mar 07 '16 at 21:37
  • One useful bit for using images: [Images and Rails](http://stackoverflow.com/questions/16843143/rails-4-image-path-image-url-and-asset-url-no-longer-work-in-scss-files). This error pops up: t.owlCarousel is not a function from your application.js file (make sure the js needed for that is loaded!) and if you are in production mode on that heroku, it's worth noting that I have sometimes had other things fail to work in prod mode once something else errors, even though they continue to work in dev along side the error (i.e. that owlCarosel error could be causing all your problems) – jacob.mccrumb Mar 07 '16 at 21:53
  • Hmm, so could I ask a quick question - if that's the case, where in the rails assets pipeline should I call libs? e.g. assets\libs\owl-carousel and then all of the files relating to owl-carousel? – Stuart Pontins Mar 07 '16 at 22:38

1 Answers1

0

We have the same issue in our project just like yours. sometimes our js files not working but no error.

try to remove

//= require turbolinks
Jomar Gregorio
  • 171
  • 1
  • 3
  • 11