Skip to content

Instantly share code, notes, and snippets.

@sibsfinx
Last active December 19, 2015 06:59
Show Gist options
  • Save sibsfinx/5915624 to your computer and use it in GitHub Desktop.
Save sibsfinx/5915624 to your computer and use it in GitHub Desktop.
scripts and stylesheets placement in layout (rails)
// https://developers.google.com/speed/docs/best-practices/rtt#PutStylesBeforeScripts
!!!
%html
%head
...
// stylesheet loads first
= stylesheet_link_tag 'application'
// main javascript file is loaded in parallel with stylesheet
= javascript_include_tag 'application'
...
%body
...
%footer
// external and additional javascript
= yield :inline_js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment