1

I have no idea why Ruby on Rails in Cloud 9 framework doesn't recognize javascript applications. I have taken Ruby on Rails course via Udemy, and here is correct repo file from Udemy teacher, and when I copy this code into Cloud 9 framework. In this file: /app/assets/javascripts/application.js there is a code block like this:

var hide_spinner = function(){
  $('#spinner').hide();
}

and within '$' sign is showing following error: $ is not defined; please fix or add /* global $ */. It's same with other files who end with .js in javascripts folder.

I have installed all gems and in application.js:

//= require jquery
//= require jquery_ujs
//= require twitter/bootstrap
// require turbolinks
//= require_tree .

Sorry for my English :)
Please help!

Thank you! ;)

1 Answers1

1

Sinmply add this:

/* global $ */

to the top of your script

and $ is not defined; please fix or add /* global $ */ will stop showing up!

Hope this helps, it worked for me!

Sami Birnbaum
  • 773
  • 8
  • 20