Hi Kieran, Thanks for that. The raw option worked. I will file a ticket on the rails lighthouse.
On 16 April 2010 20:59, Kieran P <[email protected]> wrote: > Hey Paul, > > That javascript looks correct. mail_to should return an html_safe > string. Escaped html indicates it isn't. > > So if the problem is that the html is being escaped, then this is a > bug. file a ticket on the rails lighthouse. > > To get around the bug, use <%=raw mail_to(...) %> or <%= > mail_to(...).html_safe %> > > Regards > Kieran > > On Apr 16, 8:27 am, Paul Jonathan Thompson <[email protected]> wrote: >> On 16 April 2010 03:40, Joe Smith <[email protected]> wrote: >> >> > "Paul Jonathan Thompson" <[email protected]> wrote in message >> >news:[email protected]... >> >> >> I have just started up grading to Rails 3. mail_to no longer works, >> >> you just get a lot of garbage. With what do I replace it? >> >> > The mail_to helper is still present in edge Rails, so I'm not sure what is >> > going wrong. Can you provide an example of your invocation, and what it is >> > outputting? >> >> Hi, >> >> I am using Rails 3 Beta 3. The code is: >> >> <%= mail_to(supplier.email, h(supplier.email), :subject => "Bathroom >> Direct Order:", :encode => "javascript") %> >> >> This has worked fine up till Rails 2.3.5. Below is what now appears in the >> view: >> >> <script >> type="text/javascript">eval(decodeURIComponent('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%70%6f%72%69%72%75%61%40%61%64%76%61%6e%63%65%65%6c%65%63%74%72%69%63%61%6c%2e%63%6f%2e%6e%7a%3f%73%75%62%6a%65%63%74%3d%42%61%74%68%72%6f%6f%6d%25%32%30%44%69%72%65%63%74%25%32%30%4f%72%64%65%72%25%33%41%22%3e%70%6f%72%69%72%75%61%40%61%64%76%61%6e%63%65%65%6c%65%63%74%72%69%63%61%6c%2e%63%6f%2e%6e%7a%3c%2f%61%3e%27%29%3b'))</script> >> >> Guidance will be most welcome. >> >> Regards, >> >> Paul > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

