Rails Changing X-Frame Settings

Sorry for asking such a question about noob, but I just don't get it. I am playing with a Rails server, and now I need to embed it in iFrame. I have seen here and here how to change the x-frame settings, but for my life I can’t find out where I need to do this. I'm not sure if I just need to paste this somewhere in my application configuration file, my rails configuration file (which seems unlikely to me), but I'm obviously missing something.

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

As always; Thanks in advance to everyone.

+6
source share
1 answer

You put it in the config/application.rb file. Open the file and you can see where to add it. I use

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

to keep the rest of the default headers

+11
source

Source: https://habr.com/ru/post/949518/


All Articles