Module: InertiaRails::Controller

Extended by:
ActiveSupport::Concern
Defined in:
lib/inertia_rails/controller.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#default_renderObject



36
37
38
39
40
41
42
# File 'lib/inertia_rails/controller.rb', line 36

def default_render
  if InertiaRails.default_render?
    render(inertia: true)
  else
    super
  end
end

#inertia_view_assignsObject



58
59
60
61
# File 'lib/inertia_rails/controller.rb', line 58

def inertia_view_assigns
  return {} unless @_inertia_instance_props
  view_assigns.except(*@_inertia_skip_props)
end

#redirect_back(fallback_location:, allow_other_host: true, **options) ⇒ Object



49
50
51
52
53
54
55
56
# File 'lib/inertia_rails/controller.rb', line 49

def redirect_back(fallback_location:, allow_other_host: true, **options)
  capture_inertia_errors(options)
  super(
    fallback_location: fallback_location,
    allow_other_host: allow_other_host,
    **options,
  )
end

#redirect_to(options = {}, response_options = {}) ⇒ Object



44
45
46
47
# File 'lib/inertia_rails/controller.rb', line 44

def redirect_to(options = {}, response_options = {})
  capture_inertia_errors(response_options)
  super(options, response_options)
end