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

Java - Error: no suitable method found for add(int, java.lang.String) -

c# - passing input text from view to contoller with FacebookContext using Facebook app -

Calling a C++ function from C# by passing a string with variable size to it -