timeagoまたはeasydateを<time class="prettydate"><%= created_at %></time>"
(このようなものを出力する)にどのように適用しますMon Jun 18 03:46:27 +0000 2012
か?
以下を試しましたが、バックボーン/アンダースコアを使用して日付をレンダリングしているため、機能しません。
$(function() {
$('time.prettydate').easydate();
});
これが私の見解です:
( function ( views ){
views.ResultView = Backbone.View.extend({
tagName : 'li',
template: _.template($('#resultItemTemplate').html()),
initialize: function() {
this.model.bind('change', this.render, this);
this.model.bind('destroy', this.remove, this);
},
render : function () {
//this.$el.html(this.template(this.model.toJSON()));
var html = this.template(this.model.toJSON());
this.$el.html($(html).timeago());
}
});
})( app.views );