Issue #8631 has been updated by rosenfeld (Rodrigo Rosenfeld Rosas).


You can see here how often people want to use a hash to render an ERB template:

https://github.com/search?q=erb+result+openstruct&type=Code&ref=searchresults

And there's no quick way for performing this common procedure. The quickest one seems to be using OpenStruct for that...
----------------------------------------
Feature #8631: Add a new method to ERB to allow assigning the local variables from a hash
https://bugs.ruby-lang.org/issues/8631#change-40507

Author: rosenfeld (Rodrigo Rosenfeld Rosas)
Status: Assigned
Priority: Low
Assignee: seki (Masatoshi Seki)
Category: 
Target version: 


It would be interesting if ERB could allow a hash instead of a binding for processing the template.

We wouldn't have to do hacks like:

b = OpenStruct.new(hash).instance_eval{ binding }



-- 
http://bugs.ruby-lang.org/