Last active
August 26, 2015 21:10
-
-
Save adampats/11443979fa1a71851ac7 to your computer and use it in GitHub Desktop.
ERB result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# define some stuff | |
@var1 = "hello" | |
@var2 = { key: "stuff", value: "world" } | |
# populate using ERB | |
e = ERB.new( File.read('test.erb') ) | |
e.result(binding) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"foo": "bar", | |
"var1": <%= @var1 %>, | |
"var2": <%= @var2[:value] %> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment