mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-31 21:37:16 +00:00
18 lines
505 B
Ruby
18 lines
505 B
Ruby
# frozen_string_literal: true
|
|
|
|
module FullUrlHelper
|
|
def url_helpers
|
|
# This is how we can get the helpers with a usable root_url outside the controllers
|
|
Rails.application.routes.default_url_options = ActionMailer::Base.default_url_options
|
|
Rails.application.routes.url_helpers
|
|
end
|
|
|
|
def full_checkout_path
|
|
URI.join(url_helpers.root_url, url_helpers.checkout_path).to_s
|
|
end
|
|
|
|
def full_order_path(order)
|
|
URI.join(url_helpers.root_url, url_helpers.order_path(order)).to_s
|
|
end
|
|
end
|