Allow custom rails generators to pass in their own binding to Create command so that the corresponding erb templates get rendered with the proper binding [#1493 state:resolved]

This commit is contained in:
Joshua Peek 2008-12-28 15:10:41 -06:00
parent 1e45818a62
commit 1f0aecd931
1 changed files with 1 additions and 1 deletions

View File

@ -294,7 +294,7 @@ HELP
file(relative_source, relative_destination, template_options) do |file|
# Evaluate any assignments in a temporary, throwaway binding.
vars = template_options[:assigns] || {}
b = binding
b = template_options[:binding] || binding
vars.each { |k,v| eval "#{k} = vars[:#{k}] || vars['#{k}']", b }
# Render the source file with the temporary binding.