Skip to content

Instantly share code, notes, and snippets.

@mwlang
Created August 18, 2015 02:37
Show Gist options
  • Save mwlang/461ebad1f6445c5a2e33 to your computer and use it in GitHub Desktop.
Save mwlang/461ebad1f6445c5a2e33 to your computer and use it in GitHub Desktop.
Need newlines "\n" in Ruby? No problem, here's a great way *not* to generate them!
def formated_item_details_for_mail(mail_to,host_name,use_non_vat_price = false)
ascii_formated_item_details = %{#{self.printed_title}} + %{
}
ascii_formated_item_details += %{#{self.publication_year}} + %{
}
ascii_formated_item_details += %{#{poly_formatted_price_controller_or_model(self.get_basis_price(use_non_vat_price))}} +%{
}
ascii_formated_item_details += %{http://#{host_name}#{Page.find(SystemSettings[:default_item_viewer_page_id]).absolute_url}/#{self.id}}
end
return ascii_formated_item_details
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment