Class: SolidObjects::ComponentPathResolver
- Inherits:
-
Object
- Object
- SolidObjects::ComponentPathResolver
- Defined in:
- lib/solid_objects/component_path_resolver.rb,
sig/generated/lib/solid_objects/component_path_resolver.rbs
Instance Method Summary collapse
Instance Method Details
#call(view_context:) ⇒ String
6 7 8 9 10 11 12 13 |
# File 'lib/solid_objects/component_path_resolver.rb', line 6 def call(view_context:) unless mounted? raise UnsupportedComponentRendering, "reactive components require the SolidObjects::Engine to be mounted in the host routes" end SolidObjects::Engine.routes.url_helpers.components_path end |
#mounted? ⇒ Boolean
18 19 20 21 22 23 24 25 |
# File 'lib/solid_objects/component_path_resolver.rb', line 18 def mounted? return false unless defined?(Rails) && Rails.application Rails.application.routes.routes.any? do |route| route.app.respond_to?(:app) && route.app.app.equal?(SolidObjects::Engine) end end |