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? Thanks Paul Thompson -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
"Paul Jonathan Thompson" <rails001-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote in message news:h2p603755611004142229h2d4f7013pde4320967c722e0e-JsoAwUIsXouq+1Nelnf3ueG/Ez6ZCGd0@public.gmane.org>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? -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 16 April 2010 03:40, Joe Smith <unknown_kev_cat-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:> > "Paul Jonathan Thompson" <rails001-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote in message > news:h2p603755611004142229h2d4f7013pde4320967c722e0e-JsoAwUIsXouq+1Nelnf3ueG/Ez6ZCGd0@public.gmane.org >> >> 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 15/04/2010 21:27, Paul Jonathan Thompson wrote:> On 16 April 2010 03:40, Joe Smith <unknown_kev_cat-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote: >> >> "Paul Jonathan Thompson" <rails001-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote in message >> news:h2p603755611004142229h2d4f7013pde4320967c722e0e-JsoAwUIsXouq+1Nelnf3ueG/Ez6ZCGd0@public.gmane.org >>> >>> 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 >Isn''t that rails obfuscating the mailto link so that parsers cannot harvest email addresses so easily? Does the mailto link work if you follow it? HTH Matt -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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 <rails...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 16 April 2010 03:40, Joe Smith <unknown_kev_...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote: > > > "Paul Jonathan Thompson" <rails...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote in message > >news:h2p603755611004142229h2d4f7013pde4320967c722e0e-JsoAwUIsXouq+1Nelnf3ueG/Ez6ZCGd0@public.gmane.org > > >> 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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 <kieran776-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 <rails...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> On 16 April 2010 03:40, Joe Smith <unknown_kev_...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote: >> >> > "Paul Jonathan Thompson" <rails...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote in message >> >news:h2p603755611004142229h2d4f7013pde4320967c722e0e-JsoAwUIsXouq+1Nelnf3ueG/Ez6ZCGd0@public.gmane.org >> >> >> 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.