Sha256: d29e0be3787f8153a08f0433b6b3f2d61595626c049e76acf40d4cdb1e3af656

Contents?: true

Size: 428 Bytes

Versions: 1

Compression:

Stored size: 428 Bytes

Contents

# Patch BetterErrors::Middleware to render HTML for Inertia requests
#
# Original source:
# https://github.com/BetterErrors/better_errors/blob/v2.5.1/lib/better_errors/middleware.rb
#

module InertiaRails
  module InertiaBetterErrors
    def text?(env)
      return false if env["HTTP_X_INERTIA"]

      super
    end
  end
end

if defined?(BetterErrors)
  BetterErrors::Middleware.include InertiaRails::InertiaBetterErrors
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
inertia_rails-3.5.0 lib/patches/better_errors.rb