Skip to content

Instantly share code, notes, and snippets.

@marvinahv
Last active October 5, 2016 14:27
Show Gist options
  • Save marvinahv/5538743 to your computer and use it in GitHub Desktop.
Save marvinahv/5538743 to your computer and use it in GitHub Desktop.
Minimalistic slim layout
doctype html
html lang="en"
head
meta charset="utf-8"
meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"
title
meta name="description" content=""
meta name="author" content=""
meta name="keywords" content=""
meta name="viewport" content="width=device-width, initial-scale=1.0"
== yield_content :stylesheets
link rel="stylesheet" href="/css/main.css?version=0.1"
== csrf_meta_tags
== include_gon
body
#main
== yield
javascript:
$(window).load(function(){
// set the x-csrf-token for each ajax operation
// rack / rack_csrf handle the rest
(function(jQuery) {
$.ajaxSetup({
beforeSend: function(xhr) {
var token = jQuery('meta[name="csrf-token"]').attr('content');
xhr.setRequestHeader('X-CSRF-Token', token);
}
});
}(jQuery));
});
== yield_content :scripts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment