Module: Alchemy::JsonApi::LinkHelper

Defined in:
lib/alchemy/json_api/link_helper.rb

Instance Method Summary collapse

Instance Method Details



5
6
7
8
9
10
11
12
13
# File 'lib/alchemy/json_api/link_helper.rb', line 5

def alchemy_link(path_base, object)
  return unless object

  if Rails.application.routes.default_url_options[:host]
    Alchemy::Engine.routes.url_helpers.public_send("#{path_base}_url", object)
  else
    Alchemy::Engine.routes.url_helpers.public_send("#{path_base}_path", object)
  end
end