I’ve a local variable that contains the following hash retrieved from the frontmatter of a file using the YAML.load function. The content is then returned into a variable called test
{"class"=>"default", "text"=>"My Text!", "url"=>"#"}
I don’t know how to access to the individual keys.
I tried in several ways, including
<%= test.("#{url}") %>
But all I get is an error from the compiler who doesn’t know the local variable.
If I do something like
<%= test[:url] %>
I get no output, but also no errors, meaning that I may potentially be on the right way?
Is there anything I can read re ruby to learn this kind of things?
Thanks