jeudi 25 mars 2021

Rendering amount of months something was done in html.erb

I am wondering if it's possible to get amount of months in rails from response. If my data contains published.at: '2020-12-31 08:00:00 UTC'. How can I render in my html Published: 3 months ago instead of displaying the entire date? Now I display it as <%= item.published_at %>

Aucun commentaire:

Enregistrer un commentaire