diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-12-28 15:10:41 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-12-28 15:10:41 -0600 |
commit | 1f0aecd931a9292b52402143be979ab4c06f06cd (patch) | |
tree | 17846d1308ced086fc5b6b0babc2bb196cc4d12e /railties | |
parent | 1e45818a622405e720a4529795f8be2f11660361 (diff) | |
download | rails-1f0aecd931a9292b52402143be979ab4c06f06cd.tar.gz rails-1f0aecd931a9292b52402143be979ab4c06f06cd.tar.bz2 rails-1f0aecd931a9292b52402143be979ab4c06f06cd.zip |
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]
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails_generator/commands.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/lib/rails_generator/commands.rb b/railties/lib/rails_generator/commands.rb index cacb3807d6..299044c3d7 100644 --- a/railties/lib/rails_generator/commands.rb +++ b/railties/lib/rails_generator/commands.rb @@ -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. |