Something like:
<%= raw transaction.invoice_number %>
And a better solution is to store only the URL on the database and build the link the View, so you can change how to render this link easily in the future.
I would recommend <%= sanitize transaction.invoice_number %> instead of raw. Rubocop will yell at you for using raw. sanitize will pass back the same HTML and mark it as safe, but after scrubbing it of anything that could possibly get into it and turn it against you.
I would recommend not storing markup in your DB. If you need to store the URL as a separate data point from your invoice number then create a field for that. So: