Module: Thredded::MainAppRouteDelegator
- Defined in:
- lib/thredded/main_app_route_delegator.rb
Overview
If thredded is rendered within an application layout, this module allows referring to the routes in the layout directly, without having to use ‘main_app.`.
Instance Method Summary collapse
-
#method_missing(method, *args, &block) ⇒ Object
delegate url helpers to main_app.
- #respond_to_missing?(method, *args) ⇒ Boolean
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
delegate url helpers to main_app
7 8 9 10 11 12 13 |
# File 'lib/thredded/main_app_route_delegator.rb', line 7 def method_missing(method, *args, &block) if main_app_route_method?(method) main_app.send(method, *args) else super end end |
Instance Method Details
#respond_to_missing?(method, *args) ⇒ Boolean
15 16 17 |
# File 'lib/thredded/main_app_route_delegator.rb', line 15 def respond_to_missing?(method, *args) super || main_app_route_method?(method) end |