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
Post a Comment