Ruby string concat with webrick -


I have this code that I want to modify (new in Ruby)

  HRand = rand (10) .to_s if (request.path == '/ test') response.status = 200 response ['content-type'] = 'text / html' response.body = File.read ('C: \ # # {HRand} .html ')   

When I use Localhost: 8080 / test me

"No such file or directory C: \ # {hRand} .html "

Why is not being changed? This is because string projection only works with double quoted strings:

pre> file. ("C: \ # # hRand} .html")

Comments

Popular posts from this blog

How can I add a seperate action listener to all 14 of my buttons at once that can determine player turn?(java) -

php - Sorting an multidimension array using usort fails -

Simple file compression in C -