Skip to content

Instantly share code, notes, and snippets.

View xpressivecode's full-sized avatar

Mike Fitzgerald xpressivecode

View GitHub Profile
@xpressivecode
xpressivecode / iron-router-resource.js
Last active December 24, 2015 14:38
Sample for routing resources using IronRouter
IronRouter.prototype.mapResource = function(resource){
var router = this;
var _routes = [
{ name: resource, path: '/' + resource, action: 'index' },
{ name: 'show' + resource, path: '/' + resource + '/:id', action: 'show' }
];
_.each(_routes, function(route, index){
router.map(function(){
this.route(route.name, {