I know how to use erb, and have done so on rails and in standalone ruby apps.. I don't know where it came from, as I have never installed it but it's there. I used rbenv on my mac.
I installed ruby on a windows 8 computer using the rails installer and can't seem to access erb.
how do you install erb??? (Or is there something I'm missing)
ERB module comes with standard libaray in Ruby. You just need to require it.
require 'erb'
temp = "<%= var %>"
erb = ERB.new(temp)
var = "hi"
erb.result(binding) # => "hi"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With