How to access backend vars on the frontend in Ruby
How would I access the visitor's var in my index.html file?
Answered by CodingCactus (4336) [earned 5 cycles]
you should use erb files, not html ones
A little example:
get "/" do @randnum = rand(1..10) erb :index end
<p><%= @randnum %></p>
If you need some explanation, let me know!