slindsey3000
slindsey3000

Reputation: 4271

Rails Asset Pipeline How Does //= require jquery work?

//= require jquery

How is the jquery library being loaded in with this?

I do not have jquery files anywhere in the project to be loaded.

What magical place are they loaded from?

Same goes for //= require bootstrap-sprockets I put this line in so that bootstrap was loaded correctly.

I have the gem but what magic is done here?

Upvotes: 1

Views: 229

Answers (1)

MZaragoza
MZaragoza

Reputation: 10111

those files got loaded because you have the gem 'jquery-rails' and the gem 'bootstrap-sass', '~> 3.3.6'

they hold the js, css, and images files in the assets directory inside there gem

what the Rails Asset Pipeline does is look at the assets and vendor directories to compile the files

I hope that this explanation works

you can see the assets for bootstrap-sass and jQuery here

Upvotes: 2

Related Questions