actionview-encoded_mail_to
actionview-encoded_mail_to copied to clipboard
Options can now be passed as html safe strings
If you call mail_to("[email protected]", "My email", subject: "Example subject", encode: "javascript")
in Rails 5 subject
option will be
passed as ActiveSupport::SafeBuffer
and not as String
.
When this option reaches Rack::Utils.escape_path
it will throw
NoMethodError: undefined method 'each_byte' for nil:NilClass
.
This is fixed by replacing extras builder with implementation from
latest Rails which uses ERB::Util.url_encode
instead of
Rack::Utils.escape_path
.