jquery - how do I use rails time_ago_in_words in backbone template -
is there way use rails standard methods such time_ago_in_words in backbone template using hamlc ? when tried
.created_at= time_ago_in_words e.created_at
it throws exception
uncaught referenceerror: time_ago_in_words not defined
had create simple method , return template. include actionview::helpers::datehelper def personalize_time(c) coll = [] c.each |v| coll << {"created_at" => time_ago_in_words(v['created_at']), "collection" => v} end coll end
Comments
Post a Comment