Rene Zammit
Rene Zammit

Reputation: 101

get ruby hash key value using Erubis

I have a hash:

hash = "email_address"=>"[email protected]"

I would like to get the value from this hash which is "[email protected]" using erubis. This doesn't work:

<% 
pp hash.[email_address]
%>

Upvotes: -1

Views: 173

Answers (1)

Kulbir Saini
Kulbir Saini

Reputation: 3915

Did you try this?

<%= pp hash["email_address"] %>

or

<%= pp hash[:email_address] %>

Upvotes: 1

Related Questions