Rails Changing X-Frame-Options
Asked Answered
H

1

7

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.

Hughie answered 16/7, 2013 at 5:21 Comment(0)
P
15

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

Phlebotomy answered 25/10, 2013 at 8:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.