Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8822

Show
Ignore:
Timestamp:
02/08/08 22:04:06 (7 months ago)
Author:
marcel
Message:

Fix problem with render :partial collections, records, and locals. #11057 [lotswholetime]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r8819 r8822  
    11*SVN* 
     2 
     3* Fix problem with render :partial collections, records, and locals. #11057 [lotswholetime]  
    24 
    35* Added support for naming concrete classes in sweeper declarations [DHH] 
  • trunk/actionpack/lib/action_view/partials.rb

    r8793 r8822  
    128128            path       = ActionController::RecordIdentifier.partial_path(partial_path.first) 
    129129            collection = partial_path 
    130             render_partial_collection(path, collection, nil, object_assigns.value
     130            render_partial_collection(path, collection, nil, local_assigns
    131131          else 
    132132            "" 
     
    135135          render_partial( 
    136136            ActionController::RecordIdentifier.partial_path(partial_path), 
    137             object_assigns, local_assigns) 
     137            partial_path, local_assigns) 
    138138        end 
    139139      end 
  • trunk/actionpack/test/activerecord/render_partial_with_record_identification_test.rb

    r8564 r8822  
    3535    end 
    3636  end 
     37  RenderPartialWithRecordIdentificationController.view_paths = [ File.dirname(__FILE__) + "/../fixtures/" ] 
    3738   
    3839  def setup 
     
    5960   
    6061  def test_rendering_partial_with_belongs_to_association 
     62    topic = Reply.find(1).topic 
    6163    get :render_with_belongs_to_association 
    6264    assert_template 'topics/_topic' 
     65    assert_equal topic.title, @response.body 
    6366  end 
    6467   
  • trunk/actionpack/test/controller/new_render_test.rb

    r8786 r8822  
    150150  def partial_collection_with_locals 
    151151    render :partial => "customer_greeting", :collection => [ Customer.new("david"), Customer.new("mary") ], :locals => { :greeting => "Bonjour" } 
     152  end 
     153 
     154  def partial_collection_shorthand_with_locals 
     155    render :partial => [ Customer.new("david"), Customer.new("mary") ], :locals => { :greeting => "Bonjour" } 
    152156  end 
    153157 
     
    709713  end 
    710714 
     715  def test_partial_collection_shorthand_with_locals 
     716    get :partial_collection_shorthand_with_locals 
     717    assert_equal "Bonjour: davidBonjour: mary", @response.body 
     718  end 
     719 
    711720  def test_empty_partial_collection 
    712721    get :empty_partial_collection