How to override X-Frame-Options for a controller or action in Rails 4
If you want to remove the header completely, you can create an after_action filter: class FilesController < ApplicationController after_action :allow_iframe, only: :embed def embed end private def allow_iframe response.headers.except! ‘X-Frame-Options’ end end Or, of course, you can code the after_action to set the value to something different: class FacebookController < ApplicationController after_action :allow_facebook_iframe private def … Read more