-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathinertia_rails.rb
More file actions
36 lines (31 loc) · 890 Bytes
/
inertia_rails.rb
File metadata and controls
36 lines (31 loc) · 890 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
require 'inertia_rails/renderer'
require 'inertia_rails/engine'
require 'patches/debug_exceptions'
require 'patches/better_errors'
require 'patches/request'
require 'patches/mapper'
ActionController::Renderers.add :inertia do |component, options|
InertiaRails::Renderer.new(
component,
self,
request,
response,
method(:render),
props: options[:props],
view_data: options[:view_data],
deep_merge: options[:deep_merge],
).render
end
module InertiaRails
class Error < StandardError; end
class UnoptimizedPartialReload < StandardError
attr_reader :paths
def initialize(paths)
@paths = paths
super("The #{paths.join(', ')} prop(s) were excluded in a partial reload but still evaluated because they are defined as values.")
end
end
def self.deprecator # :nodoc:
@deprecator ||= ActiveSupport::Deprecation.new
end
end