当尝试使用collection_select显示eamil时,获取[email protected]

时间:2021-10-03 23:41:58

I am using Ruby 1.8.7 with Rails 2.3.9. When creating a drop down of email addresses using collection select, the emails addresses are not displaying. Instead I am seeing "[email protected]" in the drop down. Is there some switch that is causing this?

我正在使用Ruby 1.8.7和Rails 2.3.9。当使用集合选择创建电子邮件地址的下拉时,电子邮件地址不会显示。相反,我看到的是“[email protected]”。是不是有什么开关导致了这个?

There seems to be some javascript that is being applied to each item in the drop down by rails when it sees an email in the list. The javascript is not there when I just list the user names.

当rails看到列表中的电子邮件时,似乎有一些javascript应用于下拉列表中的每个条目。当我列出用户名时,javascript不在那里。

<script type="text/javascript">
/* <![CDATA[ */
3(function(){try{var s,a,i,j,r,c,l=document.getElementById("__cf_email__");a=l.getAttribute("cf_sec");if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
4/* ]]> */ 
<script/>

3 个解决方案

#1


37  

Hoa you are correct this isn't rails related.

你是对的,这与rails无关。

I found that this caused by the CDN we are using CloudFlare. As part of their security settings they obscure emails.

我发现这是我们使用CloudFlare的CDN引起的。作为安全设置的一部分,他们会屏蔽电子邮件。

You can turn this off by going to the CloudFlare settings on your CloudFlare account and turn off E-mail Address Obfuscation.

您可以通过转到CloudFlare帐户上的CloudFlare设置并关闭电子邮件地址混淆来关闭此功能。

Update: This is definitely a CloudFlare setting that prevents emails from being displayed (saw this happen in my active_admin), but know that you can also add some HTML to the output that CloudFlare will look for around the email output:

更新:这绝对是一个CloudFlare设置,可以防止邮件被显示(在我的active_admin中看到这种情况),但是知道您也可以向CloudFlare在邮件输出中查找的输出添加一些HTML:

<!--email_off--> email@example.com <!--/email_off-->

Reference:

参考:

#2


4  

Adding to @Nicolo77 answer.

增加@Nicolo77回答。

I have ran into same issue. Cloud flare by default Turn on Email Address Obfuscation. You can change it on your could flare dashboard:

我遇到过同样的问题。默认情况下,Cloud flare打开电子邮件地址混淆。您可以在您的could flare仪表板上进行更改:

Login->Scrape Shield->Email Address Obfuscation -> Turn Off

登录->刮屏->电子邮件地址混淆->关闭

#3


0  

The should be a switch when you go to Security Settings -> E-mail Address Obfuscation .

当您进入安全设置时,应该切换到>电子邮件地址混淆。

#1


37  

Hoa you are correct this isn't rails related.

你是对的,这与rails无关。

I found that this caused by the CDN we are using CloudFlare. As part of their security settings they obscure emails.

我发现这是我们使用CloudFlare的CDN引起的。作为安全设置的一部分,他们会屏蔽电子邮件。

You can turn this off by going to the CloudFlare settings on your CloudFlare account and turn off E-mail Address Obfuscation.

您可以通过转到CloudFlare帐户上的CloudFlare设置并关闭电子邮件地址混淆来关闭此功能。

Update: This is definitely a CloudFlare setting that prevents emails from being displayed (saw this happen in my active_admin), but know that you can also add some HTML to the output that CloudFlare will look for around the email output:

更新:这绝对是一个CloudFlare设置,可以防止邮件被显示(在我的active_admin中看到这种情况),但是知道您也可以向CloudFlare在邮件输出中查找的输出添加一些HTML:

<!--email_off--> email@example.com <!--/email_off-->

Reference:

参考:

#2


4  

Adding to @Nicolo77 answer.

增加@Nicolo77回答。

I have ran into same issue. Cloud flare by default Turn on Email Address Obfuscation. You can change it on your could flare dashboard:

我遇到过同样的问题。默认情况下,Cloud flare打开电子邮件地址混淆。您可以在您的could flare仪表板上进行更改:

Login->Scrape Shield->Email Address Obfuscation -> Turn Off

登录->刮屏->电子邮件地址混淆->关闭

#3


0  

The should be a switch when you go to Security Settings -> E-mail Address Obfuscation .

当您进入安全设置时,应该切换到>电子邮件地址混淆。