// Inspired from Paul Irish and Jason Garber

APP = {};
 
GIStyle = {
  exec: function( controller, action ) {
    var ns = APP, action = ( action === undefined ) ? "init" : action;
 
    if ( controller !== "" && ns[controller] && typeof ns[controller][action] == "function" ) {
      ns[controller][action]();
    }
  },
 
  init: function() {
    var body = document.body,
        controller = body.getAttribute("data-controller"),
        action = body.getAttribute("data-action");
 
    if(typeof APP.init == "function") APP.init();
    GIStyle.exec(controller);
    GIStyle.exec(controller, action);
  }
};

$(document).ready(GIStyle.init);
// Inspired from Paul Irish and Jason Garber

APP = {};
 
GIStyle = {
  exec: function( controller, action ) {
    var ns = APP, action = ( action === undefined ) ? "init" : action;
 
    if ( controller !== "" && ns[controller] && typeof ns[controller][action] == "function" ) {
      ns[controller][action]();
    }
  },
 
  init: function() {
    var body = document.body,
        controller = body.getAttribute("data-controller"),
        action = body.getAttribute("data-action");
 
    if(typeof APP.init == "function") APP.init();
    GIStyle.exec(controller);
    GIStyle.exec(controller, action);
  }
};

$(document).ready(GIStyle.init);
$(document).on('page:load', GIStyle.init) // support Turbolinks
Revert "remove turbolinks support, alternativly use jquery.turbolinks gem"
Revert "remove turbolinks support, alternativly use jquery.turbolinks gem"

This reverts commit a2d0358429d64c87cd354f43ca976fa6147ea0c6.
