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

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -