Permalink
Browse files

Backed out of locals hash as it caused trouble with Builder, see tick…

…et for more

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5043 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 8c9ce61 commit 83313fccc04f659b766a8f5e8bcf4a5cb67a8b2a @dhh dhh committed Sep 6, 2006
Showing with 1 addition and 34 deletions.
  1. +0 −11 actionpack/CHANGELOG
  2. +1 −1 actionpack/lib/action_view/base.rb
  3. +0 −22 actionpack/test/controller/render_test.rb
View
@@ -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]
@@ -456,7 +456,7 @@ def create_template_source(extension, template, render_symbol, locals)
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
@@ -93,28 +93,6 @@ def accessing_local_assigns_in_inline_template_with_string_keys
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

0 comments on commit 83313fc

Please sign in to comment.