module Thredded::Workgroup::RouteDelegator
Public Class Methods
add_my_proxies_to_thredded()
click to toggle source
# File lib/thredded/workgroup/route_delegator.rb, line 8 def self.add_my_proxies_to_thredded thredded_methods = Thredded::Engine.routes.url_helpers.methods my_route_helpers = Thredded::Workgroup::Engine.routes.url_helpers path_methods = my_route_helpers.methods.select { |s| s.to_s.ends_with?("_path", "_url") } .reject { |s| thredded_methods.include?(s) } path_methods.each do |method_name| send(:define_method, method_name) do |*args| my_route_helpers.send(method_name, *args) end end ::Thredded::ApplicationController.send(:include, ::Thredded::Workgroup::RouteDelegator) # if we need to use in views, then we add # ::Thredded::ApplicationController.helper(::Thredded::Workgroup::RouteDelegator) end