actionview-encoded_mail_to
actionview-encoded_mail_to copied to clipboard
Wrong print encoded mail_to
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 :(
Temporal solution:
- use
'hex'
encode.