dimanche 21 juin 2015

How to use erb helpers on content that is stored on DB?

I have articles stored on my db.

I display them using on the front-end using:

<%= raw @article.content %>

Problem is if I want images or any other dynamic content. Because images are generated with the cache buster hash, I want to use the image_tag helper. Is there a way to call rails erb helpers when displaying content from the db?

Aucun commentaire:

Enregistrer un commentaire