javascript - Return url from global template helper using CollectionFS -


im trying url of uploaded image using global template helper. far tried doing isprimary.url() null, otherwise isprimary.url returns function. idea how deal this?

user_item.html

<template name="useritem">   <div class="col-md-3">     <div class="text-center">       <img width="80" class="img-rounded" src="{{primarypicture store='thumb'}}">            </div>   </div> </template> 

global_templates.js

template.registerhelper('primarypicture', function () {   var isprimary = images.findone({userid: this._id, primary: true});   if (isprimary) {     return isprimary.url();   } else {     return '/user.png';   } }); 

i dont know why isprimary.url(); returns null when should return original url, fix doing isprimary.url({store:'thumb'});


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -