Skip to content

Instantly share code, notes, and snippets.

@benphelps
Created November 16, 2016 13:33
Show Gist options
  • Save benphelps/0a0127d8abe4ecd3db0cb678a4ac1d34 to your computer and use it in GitHub Desktop.
Save benphelps/0a0127d8abe4ecd3db0cb678a4ac1d34 to your computer and use it in GitHub Desktop.
module LocationHelper
def render_location_html(location)
content_tag :address do
content = ''
content += location.address_1 + tag(:br) if location.address_1.present?
content += location.address_2 + tag(:br) if location.address_2.present?
content += location.address_3 + tag(:br) if location.address_3.present?
content += location.short if location.short.present?
content
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment