How to access backend vars on the frontend in Ruby
How would I access the visitor's var in my index.html file?
You are viewing a single comment. View All
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!