From df70e28e037952c8dee8e66b3ae683e5976e4f1d Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 4 Sep 2006 20:01:52 +0000 Subject: Added locals hash to partials, which makes for convenient access of some times available/some times not variables (closes #5491) [wbruce@gmail.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4997 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_view/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index f3e2347d45..d8e4f80e99 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -456,7 +456,7 @@ module ActionView #:nodoc: locals_keys = @@template_args[render_symbol].keys | locals @@template_args[render_symbol] = locals_keys.inject({}) { |h, k| h[k] = true; h } - locals_code = "" + locals_code = "locals = local_assigns.with_indifferent_access\n" locals_keys.each do |key| locals_code << "#{key} = local_assigns[:#{key}] if local_assigns.has_key?(:#{key})\n" end -- cgit v1.2.3