actionview-encoded_mail_to icon indicating copy to clipboard operation
actionview-encoded_mail_to copied to clipboard

Wrong print encoded mail_to

Open maguri opened this issue 6 years ago • 1 comments

When I set the mail encoded like so:

<%= mail = mail_to("[email protected]", nil, encode: "javascript") %>

and try to use this mail variable on the html page, the script prints the mail to the html parent where was called the mail_to method and not where the variable is used.

gem ref: mail_to_with_encoding.rb#L92

What I really want to do is to send the variable to a translation using a i18n key in the html like:

<%= t('my.key', email: email) %>
my:
  key: "<p>My translations use %{email} here and then,</p>
        <p>I would like to print the %{email} here, but does not work :(</p>"

The result of using the tranlation key in the html shows the following text:

My translations use [email protected]@domain.com here and then,
I would like to print the here, but does not work :(

maguri avatar Jul 11 '18 13:07 maguri

Temporal solution:

  • use 'hex' encode.

maguri avatar Jul 12 '18 09:07 maguri