Skip to content

Instantly share code, notes, and snippets.

@digitalplaywright
Last active August 29, 2015 14:00
Show Gist options
  • Save digitalplaywright/11362517 to your computer and use it in GitHub Desktop.
Save digitalplaywright/11362517 to your computer and use it in GitHub Desktop.
Handlebars.registerHelper('can', function(permissionName, options){
var rules = this.container.lookup('rules:eval');
if ( options == null ){
options = { activity: permissionName };
}else{
options['activity'] = permissionName;
}
return Ember.Handlebars.helpers.boundIf.call(rules, "can", options);
});
@digitalplaywright
Copy link
Author

@digitalplaywright
Copy link
Author

Gets error:

Uncaught TypeError: Cannot read property 'view' of undefined

Uncaught NotFoundError: Failed to execute 'setStartAfter' on 'Range': The node provided is null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment