Embed hyperlink in ERB

hello all, Im developing a ruby script (ruby 1.8.7)

its a simple script to generate an email using an ERB

my ERB has this

JIRA ticket:

[ <%= issue_key %> ] - <%= summary %>

where issue_key is this, https://jira-server.com/api/rest/query/ABC-123

I was wondering if its possible to embed that hyperlink somehow the ERB. When I get the email from this script, it embeds everything as plain text, I cant find a way to embed a hyperlink into a string

similar to this,

[ ABC-123 ]

Im generating the template like this from my .rb

templ = File.read(‘templates/’ + template + ‘.erb’)

generate = ERB.new(templ,nil,">").result(binding)


If you want the link text to be the last bit of the issue_key, you can get that by using the built-in File.basename method, and make this your content:

[ <%= File.basename(issue_key) %> ]

Note that this is an off-label use of File.basename, but it works since URL paths look just like file paths. I have no recollection of the libraries available in 1.8.7 which has been obsolete for years now, but File.basename was there.