You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
460 B

  1. # frozen_string_literal: true
  2. module RoutingHelper
  3. extend ActiveSupport::Concern
  4. include Rails.application.routes.url_helpers
  5. include ActionView::Helpers::AssetTagHelper
  6. included do
  7. def default_url_options
  8. ActionMailer::Base.default_url_options
  9. end
  10. end
  11. def full_asset_url(source, options = {})
  12. Rails.configuration.x.use_s3 ? source : URI.join(root_url, ActionController::Base.helpers.asset_url(source, options)).to_s
  13. end
  14. end