Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save floriandejonckheere/118e58b835d2ee6fa4f8e452db35acfb to your computer and use it in GitHub Desktop.
Save floriandejonckheere/118e58b835d2ee6fa4f8e452db35acfb to your computer and use it in GitHub Desktop.
Allow embedding of Rails controllers in iframes
# frozen_string_literal: true
class ApplicationController < ActionController::API
after_action :allow_iframe
protected
def allow_iframe
response.headers['X-Frame-Options'] = 'ALLOW-FROM localhost:3000'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment