Browse Source

Added optional text attribute to location link

development
Godwin 7 years ago
committed by GitHub
parent
commit
89009d5a93
  1. 8
      app/helpers/geocoder_helper.rb

8
app/helpers/geocoder_helper.rb

@ -84,9 +84,13 @@ module GeocoderHelper
return hash.length > 1 ? _("geography.formats.#{hash.keys.join('_')}", locale: locale, vars: hash) : hash.values.first return hash.length > 1 ? _("geography.formats.#{hash.keys.join('_')}", locale: locale, vars: hash) : hash.values.first
end end
def location_link(location) def location_link(location, text = nil)
return '' unless location.present? return '' unless location.present?
address = if location.is_a?(Location) address = if text is_a?(Symbol)
location.send(text)
elsif location.is_a?(String)
text
elsif location.is_a?(Location)
location.street location.street
else else
location.address location.address

Loading…
Cancel
Save