Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Rails 3 beta3: mail_to displays incorrectly i.e. mail_to not returning html_safe string

#4421

In Rails 3 beta3 mail_to (when used in a view) is not returning a html_safe string.

Code in view:

<%= raw mail_to(supplier.email, h(supplier.email), :subject => "Bathroom Direct Order:", :encode => "javascript") %>

Returns this in the browser:

My temporary solution (code in view) use raw to get a html_safe string:

<%= raw mail_to(supplier.email, h(supplier.email), :subject => "Bathroom Direct Order:", :encode => "javascript") %>

This returns the correct line in the browser: xyz@xyz.com

I believe this needs fixing in the Rails 3 code.

Reported by Sailorxyz · April 16th, 2010 @ 10:27 PM

State: committed
Milestone: 3.0.2
Assigned to: nobody
Importance: Low

Activity

  1. Lenary
    Lenary
    • Tag changed from mail_to to html_safe, mail_to

    Your code and highlighting is broken i think. Indeed not using the raw() method doesn't work, when it should. I shall look into this and try to make a patch.

    April 16th, 2010 @ 10:54 PM

  2. Lenary
    Lenary
    • Tag changed from html_safe, mail_to to html_safe, mail_to, patch

    Ok, I have a patch and have updated the tests.

    It should all pass and do what you need it to.

    April 16th, 2010 @ 11:32 PM

  3. Santiago Pastorino
    Santiago Pastorino
    • Milestone cleared.
    • State changed from new to open

    April 16th, 2010 @ 11:42 PM

  4. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to verified

    April 16th, 2010 @ 11:45 PM

  5. Santiago Pastorino
    Santiago Pastorino
    • State changed from verified to committed

    Remember to patch with [#bug_id state:committed] in the commit message

    April 18th, 2010 @ 09:14 PM

  6. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 3.0.2
    • Importance changed from to Low

    October 15th, 2010 @ 11:01 PM