Dust.js partails newbie

I have piece of code which I want to use in some of the dust templates, so i am planning to use partials. I am not sure if following is the best approach. Please help.

1) I extracted common code from base templates in to a template file called userinfo.html
2) I compiled userinfo.html to create userinfo.dust
3) I added {>"userinfo.dust"/} code into all templates where I wanted to see user information.
4) Now when I render the template with following command. I get "Template not found: userinfo.dust" error.

dust.render("moduleTemplate", templateData, function(err, out) {
    $main.html(out);  
}); 

Do, I need to send userinfo.dust along with templateData while rendering? I tried reading all partial related information which google can give me, but not able to to figure how to implement partials.

In your template, when you call:

{>"userinfo.dust"/} 

You should really be calling

{>"userinfo"/}

As yo don't need to specify the .dust extension. Here's a template example of mine:

{>header /}
    {>results /}
{>footer /}

HTH

It sounds like the answer to your problem is that the partial is not being included on the page. Dust compiles to JavaScript, so this will make more sense if you rename your files: userinfo.dust (the template), and userinfo.js (the compiled template). Now include your template using a script tag:

<script type="text/javascript" src="templates/userinfo.js"></script>

Finally, you need to call the template using the svame name it was compiled with. It is a good idea to use the filename (often but not necessarily without the extension):

var userinfoCompiled = dust.compile('userinfo', 'user info template goes here');

A template compiled in this way can be called using:

{>userinfo/}

If you're not sure what your compiled template's name is, you can open the compiled JavaScript file and look for:

dust.register('userinfo')