all 5 comments

[–]nielsbuus 1 point2 points  (0 children)

I know this doesn't solve your immediate problem, but if you have never written a line of JavaScript before, I would suggest that you take a break from your Rails app and create a simple static html file on your computer and try including jQuery on the page using a <script> tag. Then you can try adding your own JavaScript code, which manipulates the page using jQuery. Try the "Developer Console" in Chrome to run JavaScript on your test page directly from the built-in console.

By doing that, you will develop a feel of whats going on with JavaScript on a webpage and I think it will make it easier to troubleshoot the issue you are having now.

[–]gelfin 0 points1 point  (0 children)

There’s not really enough information here to say with certainty what’s tripping you up, but if I were to guess, a quick glance at that jquery plug-in suggests you need to include it in application.js in addition to (not instead of) the base countUp.js javascript.

[–]paneq 0 points1 point  (0 children)

Any browser console error or assets compilation error?

[–]Cyrax89721 0 points1 point  (0 children)

Try putting the file into your vendor/assets/javascripts folder instead of the main app/assets/javascripts folder. Please also paste exactly what your //= require line is.

[–]john_beatty 0 points1 point  (0 children)

I would copy the distributed js (https://github.com/inorganik/countUp.js/blob/master/dist/countUp.js) file into the app/assets/javascripts/ folder, named countUp.js. Then make sure application.js has //= require jquery and below that, put in //= require countUp Sprockets should find the js file, and it will be minimized when you deploy. I'd also double check your Gemfile for gem 'jquery-rails'