diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-09-06 03:38:11 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-09-06 03:38:11 +0000 |
commit | 83313fccc04f659b766a8f5e8bcf4a5cb67a8b2a (patch) | |
tree | bd0914f470b7575025441d5ab571c82a2459234e /actionpack | |
parent | 8c9ce617c9989c74209235f68ba4497b905234fd (diff) | |
download | rails-83313fccc04f659b766a8f5e8bcf4a5cb67a8b2a.tar.gz rails-83313fccc04f659b766a8f5e8bcf4a5cb67a8b2a.tar.bz2 rails-83313fccc04f659b766a8f5e8bcf4a5cb67a8b2a.zip |
Backed out of locals hash as it caused trouble with Builder, see ticket for more
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5043 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/CHANGELOG | 11 | ||||
-rw-r--r-- | actionpack/lib/action_view/base.rb | 2 | ||||
-rw-r--r-- | actionpack/test/controller/render_test.rb | 22 |
3 files changed, 1 insertions, 34 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index dfe6993714..f1a8b581cd 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -23,17 +23,6 @@ * Deprecated the auto-appending of .png to AssetTagHelper#image_tag calls that doesn't have an extension [DHH] -* Added locals hash to partials, which makes for convenient access of some times available/some times not variables #5491 [wbruce@gmail.com]. Example: - - # two different render calls - render :partial => "person", :locals => { :include_overview => true } - render :partial => "person" - - # view - <% if locals[:include_overview] %> - Show overview - <% end %> - * Fixed FormOptionsHelper#select to respect :selected value #5813 * Fixed TextHelper#simple_format to deal with multiple single returns within a single paragraph #5835 [moriq@moriq.com] diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index d8e4f80e99..f3e2347d45 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 = local_assigns.with_indifferent_access\n" + locals_code = "" locals_keys.each do |key| locals_code << "#{key} = local_assigns[:#{key}] if local_assigns.has_key?(:#{key})\n" end diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index 12340e56a6..c22702acd0 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -93,28 +93,6 @@ class TestController < ActionController::Base ActionView::Base.local_assigns_support_string_keys = false end - def accessing_locals_hash_in_inline_template - name = params[:local_name] - render :inline => "<%= 'Goodbye, ' + locals[:local_name] %>", - :locals => { :local_name => name } - end - - def accessing_locals_hash_in_inline_template_setting_string_key - name = params[:local_name] - ActionView::Base.local_assigns_support_string_keys = true - render :inline => "<%= 'Goodbye, ' + locals[:local_name] %>", - :locals => { "local_name" => name } - ActionView::Base.local_assigns_support_string_keys = false - end - - def accessing_locals_hash_in_inline_template_getting_string_key - name = params[:local_name] - ActionView::Base.local_assigns_support_string_keys = true - render :inline => "<%= 'Goodbye, ' + locals['local_name'] %>", - :locals => { :local_name => name } - ActionView::Base.local_assigns_support_string_keys = false - end - def render_to_string_test @foo = render_to_string :inline => "this is a test" end |