I have a module with a function. It resides in /lib/contact.rb:
module Contact class << self def run(current_user) ... end end end >
In your module, just perform a :
include Rails.application.routes.url_helpers