Sails uses the ejs-locals library to process partial files, which allows you to send partial parameters as the second argument. So in your template you can:
<h1>Top users: </h1>
<p>
<%= partial('user/list.ejs', {users: topUsers}) %>
</p>
<h1>New users: </h1>
<p>
<%= partial('user/list.ejs', {users: newUsers}) %>
</p>
for different values usersinside the part user/list.ejs, provided that you specify topUsersand newUsersas local when you show a view that includes a partial, i.e. in the action of your controller:
res.view("myView", {topUsers: [array of users], newUsers: [array of users]});
source
share