Could you be a little more specific? What happens in your example, exactly?
I’ve just done a quick test using your exact markup and using a known, populated object in place of your getProfileImg and it works as expected for me:
What do you see when you inspect the DOM? Is it not outputting a value at all? If it’s outputting in one then it should be outputting in another, especially as you don’t seem to have locked the helper to a template (that would have been my other guess, wrong template).
Unfortunately my advice isn’t worth a great deal as I’m also a beginner with Meteor, so I’ll let someone else comment on your general approach But from my perspective the helper looks fine.
My guess would be that your browser only looks for images at render-time, and doesn’t care when you change the src tag later, when you have the data available. What if you wrapped your img tag in its own template,
Good call - The value I checked with would have been available right away, so not the best test!
However given that @wonderjunky said that the <img /> tag worked, only the inline style attempt didn’t, wouldn’t that indicate that the helper returning a value isn’t the issue?
Seems like that. I originally read your question wrong, and thought that neither the img tag nor the div tag worked. I would also make sure, as @nathanhornby said, that when you inspect the DOM with chrome dev tools for example, that your background tag is being interpreted correctly.