Misha Moroshko
Misha Moroshko

Reputation: 171321

Why Rails doesn't include the Javascript files at the bottom of the HTML page by default?

I read here that it is better to include Javascript files at the bottom of the HTML page.

Why Ruby on Rails doesn't do so by default ?

Upvotes: 10

Views: 1647

Answers (1)

user229044
user229044

Reputation: 239230

I would guess that Rails includes your application.js in the <head> by default because it assumes you'll be minimizing things via the asset pipeline. There's no need to worry about where your script is included if it's a single external file being loaded in parallel by a single HTTP request.

Upvotes: 8

Related Questions