Ruby on rails 4 app does not work in iframe -


how can embed rails app website via iframe?

it works nicely ror 3, not ror 4:

<iframe src="http://myrailsapp.com/" width="100%" height="50" id="rails_iframe">error!</iframe> 

i tried use verify_authenticity_token , protect_from_forgery options in controller... seems it's else (but i'm not sure).

upd. example: http://jsfiddle.net/zp329/

this has rails 4 enabling additional security protocols default: http://weblog.rubyonrails.org/2013/2/25/rails-4-0-beta1/

the setting breaks iframes on remote sites x-frame-options. default, set sameorigin, prevents content being loading cross domain:

config.action_dispatch.default_headers = {     'x-frame-options' => 'sameorigin' } 

you can read new default headers here: http://edgeguides.rubyonrails.org/security.html#default-headers

in order allow iframe work cross domain, can change default headers allow x-frame across domain.

config.action_dispatch.default_headers = {     'x-frame-options' => 'allowall' } 

Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -