sighmon / mjml-rails

MJML + ERb/Haml/Slim view template
https://mjml.io
Other
295 stars 64 forks source link

image_tag helper in MJML template #82

Closed victordarras closed 3 years ago

victordarras commented 3 years ago

Hi, I'd like to use a standard rails image_tag in my template, but MJML seems to ignore it, am I doing it wrong ?

<mjml>
  <mj-body>
    <mj-section >
      <mj-column>
        <%= image_tag('logo_colored_horiz.png', width: "120" ) %>
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>
victordarras commented 3 years ago

Nevermind, I found another solution that work perfectly with :

<mj-image src="<%= image_url('logo_colored_horiz.png') %>" width="120">

sighmon commented 3 years ago

@victordarras Nice one, that's how I call images and other assets too.