Module: Thredded::Workgroup::ThreddedRouteDelegator

Defined in:
lib/thredded/workgroup/thredded_route_delegator.rb

Class Method Summary collapse

Class Method Details

.add_thredded_proxiesObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/thredded/workgroup/thredded_route_delegator.rb', line 6

def self.add_thredded_proxies
  thredded = Thredded::Engine.routes.url_helpers
  path_methods = thredded.methods.select { |s| s.to_s.ends_with?("_path", "_url") }
  path_methods.each do |method_name|
    send(:define_method, method_name) do |*args|
      thredded.send(method_name, *args)
    end
  end
  ::Thredded::Workgroup::ApplicationController.helper(
    ::Thredded::Workgroup::ThreddedRouteDelegator
  )
end