vendor/assets/javascripts/paloma/paloma.js in paloma-3.0.2 vs vendor/assets/javascripts/paloma/paloma.js in paloma-4.0.0

- old
+ new

@@ -1,17 +1,19 @@ (function(Paloma){ + Paloma._router = new Paloma.Router('/'); + Paloma._controllerFactory = new Paloma.ControllerFactory(Paloma._router); - Paloma.router = new Paloma.Router({namespace: '/', action: '#'}); - Paloma._controllerFactory = new Paloma.ControllerFactory(Paloma.router); - - + // + // Declare Paloma controllers using this method. + // Will return a new constructor if the no controller with the passed name + // is found, else it will just return the current constructor. + // Paloma.controller = function(name){ return Paloma._controllerFactory.get(name) || Paloma._controllerFactory.make(name); }; - Paloma.engine = new Paloma.Engine({router: Paloma.router, - factory: Paloma._controllerFactory}); + Paloma.engine = new Paloma.Engine({factory: Paloma._controllerFactory}); })(window.Paloma); \ No newline at end of file