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:
parent
1e45818a62
commit
1f0aecd931
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue