Skip to content

Instantly share code, notes, and snippets.

@fabianvf
Created April 25, 2016 17:33
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save fabianvf/61fd184a49067f3a3e95fd8ce5da6897 to your computer and use it in GitHub Desktop.
How to test erb templates with ruby
<%= conditon ? 'True case' : 'False case' %>)
require 'erb'
condition = false
template = ERB.new File.read("test.erb"), nil, "%"
puts template.result(binding)
@Et7f3
Copy link

Et7f3 commented Mar 1, 2023

Very helpful

@irridescentrambler
Copy link

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment