Skip to content

Instantly share code, notes, and snippets.

@strika
Created February 16, 2017 09:10
Show Gist options
  • Save strika/31589aa7c65fe711b373e4cc672ef14d to your computer and use it in GitHub Desktop.
Save strika/31589aa7c65fe711b373e4cc672ef14d to your computer and use it in GitHub Desktop.
Module for using routes in Services and other "non-rails" classes.
module Routing
extend ActiveSupport::Concern
include Rails.application.routes.url_helpers
include Aligni::HostHelper
included do
def default_url_options
ActionMailer::Base.default_url_options
end
def controller
nil
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment