Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails Changing X-Frame-Options

Sorry for such a noob question, but I am just not figuring this out. I'm playing around with a Rails server, and for now I need to embed it in an iFrame. I've seen here and here how to change the x-frame options, but for the life of me I can't find out where I need to actually go to do this. I'm not sure if I need to just stick this somewhere in my app config file, my rails config file (which seems unlikely to me), but I'm obviously overlooking something.

(I don't know if this is necessary to know, but I'm running Ruby 1.9.3 and rails 4.0)

As always; thanks in advance everyone.

like image 436
Paul Nelson Baker Avatar asked Jul 16 '13 05:07

Paul Nelson Baker


1 Answers

You put it in the config/application.rb file. Open up the file and you should be able to see where to add it. I'm using

config.action_dispatch.default_headers.merge!({'X-Frame-Options' => 'ALLOWALL'})

so that the other default headers are preserved

like image 198
Peter Lind Avatar answered Sep 19 '22 01:09

Peter Lind