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) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -