我正在尝试在模板呈现的回调中添加由数据库中的字段填充的星级。我相信问题是老鼠找不到图像,但我在让它工作时遇到了麻烦。图片当前位于 App/public/img 中,回调中的比例代码为:
Template.game.rendered = function() {
$('.game-rating').raty({
readOnly: true,
numberMax : 5,
path: App/public/img,
score: function() {
return $(this).attr('data-score');
},
starOff: 'star-off.png',
starOn: 'star-on.png'
});