Class: InertiaRails::SSRRenderer
- Inherits:
-
Object
- Object
- InertiaRails::SSRRenderer
- Defined in:
- lib/inertia_rails/ssr_renderer.rb
Instance Method Summary collapse
-
#initialize(configuration, page:, cache: nil) ⇒ SSRRenderer
constructor
A new instance of SSRRenderer.
- #render ⇒ Object
Constructor Details
#initialize(configuration, page:, cache: nil) ⇒ SSRRenderer
Returns a new instance of SSRRenderer.
5 6 7 8 9 |
# File 'lib/inertia_rails/ssr_renderer.rb', line 5 def initialize(configuration, page:, cache: nil) @configuration = configuration @page = page @cache = cache end |
Instance Method Details
#render ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/inertia_rails/ssr_renderer.rb', line 11 def render return unless bundle_exists? if ( = ) InertiaRails.cache_store.fetch(cache_key, **) { request } else request end rescue InertiaRails::SSRError => e handle_error(e) rescue StandardError => e handle_error(InertiaRails::SSRError.from_exception(e)) end |