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

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



6
7
8
9
10
11
12
# File 'lib/thredded/main_app_route_delegator.rb', line 6

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?(method, *args) ⇒ Boolean



14
15
16
# File 'lib/thredded/main_app_route_delegator.rb', line 14

def respond_to?(method, *args)
  super || main_app_route_method?(method)
end