0

How to avoid unescaping HTML in below render tag.

nofiy_user.html.erb:

<%= render partial: "mailer_notifier/paragraph", :locals => {:asHtml => asHtml, :htmltext => I18n.t('notifications.you_added_user', resource_type: @resource_type, role: @role, resource_name: @resource_name) + ":"} %>
JohnSmith
  • 1,078
  • 1
  • 10
  • 21

1 Answers1

0

Try with 'raw' method. Something like this,

<%= render partial: "mailer_notifier/paragraph", :locals => {:asHtml => raw(asHtml), :htmltext => I18n.t('notifications.you_added_user', resource_type: @resource_type, role: @role, resource_name: @resource_name) + ":"} %>

I've assumed that you wanted to unescape asHtml value in mailer_notifier/paragraph. If your need is different than my assumption then you may consider using 'raw' method as appropriate.