Sha256: 2c0da0ba06eb8276457e41ec1ddb87045ba1917ff6307a62e43c1b38ee4be058

Contents?: true

Size: 546 Bytes

Versions: 4

Compression:

Stored size: 546 Bytes

Contents

module BetterFrameable
  extend ActiveSupport::Concern

  included do
    before_action :set_headers
    skip_before_action :verify_authenticity_token
    layout 'better_frame/application'
  end

  private
  def set_headers
    headers['Access-Control-Allow-Origin'] = ENV.fetch("BETTER_FRAME_ORIGIN", "*")
    headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'
    headers['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token'
    headers['Access-Control-Max-Age'] = "1728000"
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
better_frame-0.0.4 lib/better_frame/better_frameable.rb
better_frame-0.0.3 lib/better_frame/better_frameable.rb
better_frame-0.0.2 lib/better_frame/better_frameable.rb
better_frame-0.0.1 lib/better_frame/better_frameable.rb