简体   繁体   English

Rails 3.1 iframe问题

[英]rails 3.1 iframe issue

I am trying to open an iframe in my application and its not loading, its giving me a error message like WARNING: Can't verify CSRF token authenticity and logging me out. 我试图在我的应用程序中打开一个iframe并将其不加载,这给我一个错误消息,例如警告:无法验证CSRF令牌的真实性并注销我。 Cam any one suggest as to what could be the workaround. 可以就任何可能的解决方法提出任何建议。 Thahnks. Thahnks。

This link ( Iframe causes Can't Verify CSRF Token Authenticity n Rails ) does not answer my question, I have the p3p gem installed my iframe loads correctly, but there is any request that is happening in iframe that time niether p3p headers nor csrf token are sent 此链接( Iframe导致无法验证CSRF令牌的真实性n Rails )无法回答我的问题,我已经正确安装了iframe并安装了p3p gem,但是在iframe中发生了任何请求,同时没有p3p标头或csrf令牌已发送

Here is how i call my iframe 这是我如何称呼我的iframe

< iframe name="frmane" id="batch_grid_frame" src="<%= store_batches_path(@store, :id => @batch.id) %>" style="border:none; height:100%;width:100%;"></iframe> < iframe name="frmane" id="batch_grid_frame" src="<%= store_batches_path(@store, :id => @batch.id) %>" style="border:none; height:100%;width:100%;"></iframe>

I have tried many ways but p3p header or csrf token is not sent on requests made in iframe 我尝试了很多方法,但在iframe中发出的请求中未发送p3p标头或csrf令牌

After struggling a lot and doing research, i finally found a link which helped me resolve my issue. 经过大量的努力和研究之后,我终于找到了一个链接,可以帮助我解决问题。 http://forum.dhtmlx.com/viewtopic.php?f=19&t=32855 http://forum.dhtmlx.com/viewtopic.php?f=19&t=32855

i added the CSRF token in the dhtmlx grid and it worked ie the content inside iframe started loading 我在dhtmlx网格中添加了CSRF令牌,并且可以正常工作,即iframe中的内容开始加载

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM