Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

render :partial :collection fails in Rails 2.1

#1

Hi. I just ran into some apparent misbehavior in

your inherit_views plugin under Rails 2.1. A

<% render :partial => 'partial', :collection => ... %>

was no longer searching up the inheritance

chain, perhaps because the internal routine

'render_partial_collection' was not calling

'render_partial', but rather locating and

instantiating the template itself (well, via

one of two private helper routines).

What's attached is my quick stab at a patch

Reported by Robert Thau · July 10th, 2008 @ 11:09 PM

State: resolved
Milestone: none
Assigned to: Ian White Ian White

Activity

  1. Ian White
    Ian White

    (from [9dd29e557965f7d0a4e900e83030c690386c26fe]) Added specs for [#1 render :partial :collection fails in Rails 2.1] No failures yet http://github.com/ianwhite/inher...

    September 21st, 2008 @ 01:48 AM

  2. Ian White
    Ian White
    • State changed from new to open

    Hi Robert, so sorry this has taken so long

    I;ve added some specs testing this, but am not getting the failure on 2.1 - could you look at them http://github.com/ianwhite/inher...

    and tell me if I'm testing the right thing?

    Summary:

    if i have

    
    sub/_partial.html.erb
    sub/render_it.html.erb
    super/_partial.html.erb
    
    render_it.html.erb:
    <%= render :partial => 'partial', :collection => [1,2,3] %>
    

    when rendered from sub it renders 3 of the sub/_partial

    when rendered from super it renders 3 of the super/_partial

    Is this the aberrant stuff, or some other behaviour?

    Cheers, Ian

    September 21st, 2008 @ 01:52 AM

  3. Ian White
    Ian White

    Also not getting this on the edge version

    September 21st, 2008 @ 11:09 PM

  4. Ian White
    Ian White
    • State changed from open to resolved

    I believe this is fixed.

    November 25th, 2008 @ 01:20 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.