Skip to content

Instantly share code, notes, and snippets.

@filipebarcos
Last active October 18, 2016 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save filipebarcos/fae34d3d1339eb10e61d42abcf6f7ad3 to your computer and use it in GitHub Desktop.
Save filipebarcos/fae34d3d1339eb10e61d42abcf6f7ad3 to your computer and use it in GitHub Desktop.
client_name = ''
if @invoice.client_company_name.present?
client_name = @invoice.client_company_name.gsub(' ', ' ').gsub(/[^0-9A-z\-]/, '_').gsub('__', '_')
elsif @invoice.client_name.present?
client_name = @invoice.client_name.gsub(' ', ' ').gsub(/[^0-9A-z\-]/, '_').gsub('__', '_')
elsif @invoice.client_email.present?
client_name = @invoice.client_email.gsub(' ', ' ').gsub(/[^0-9A-z@.\-]/, '_').gsub('__', '_')
end
contractor_name = @invoice.contractor_name.gsub(' ', ' ').gsub(/[^0-9A-z\-]/, '_').gsub('__', '_')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment