使用rails 3 recaptcha。在视图_form.html.erb中插入<%= recaptcha_tags%>但是在浏览器中查看页面时会收到
<script type="text/javascript" src="http://api.recaptcha.net/challenge?k=**&error=expression"></script>
据我所知,它不会在浏览器中呈现。为什么'&lt;'而不是&lt; ?
答案 0 :(得分:2)
试试<%= raw recaptcha_tags %>
。或者在帮助器中使用html_safe
。
这里的解释:http://asciicasts.com/episodes/204-xss-protection-in-rails-3