Module: Rails::Engine::LazyRouteSet::MountedHelpers
- Extended by:
- ActiveSupport::Concern
- Includes:
- ActionDispatch::Routing::RouteSet::MountedHelpers
- Defined in:
- lib/rails/engine/lazy_route_set.rb
Overview
Mounted helpers are only defined when mount runs during the route
draw. _path/_url names are left to method_missing_module, which owns
them and relies on reload_routes_unless_loaded returning true only to
the caller that performed the load.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name) ⇒ Object (private)
51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/rails/engine/lazy_route_set.rb', line 51 def method_missing(method_name, ...) if method_name.end_with?("_path", "_url") super else Rails.application&.reload_routes_unless_loaded if ActionDispatch::Routing::RouteSet::MountedHelpers.method_defined?(method_name) public_send(method_name, ...) else super end end end |