This project is archived and is in readonly mode.

#1790 ✓stale
Thibaud Guillaume-Gentil

Partial counter with :as option

Reported by Thibaud Guillaume-Gentil | January 23rd, 2009 @ 09:48 AM | in 3.x

When rendering a partial with :as option for redefine the object name, the partial counter name isn't redefined

Example: in views/users/index.html.erb:

render :partial => 'users/smart_user', :collection => @users, :as => :user

in views/users/_smart_user.html.erb

# user_counter does NOT exist and you need to use smart_user_counter instead # but this is not optimal right?

Comments and changes to this ticket

  • Pratik

    Pratik March 23rd, 2009 @ 11:17 AM

    • Assigned user set to “Pratik”

    Yup. Looks like a bug to me. Do you wanna take a stab at writing a patch/test ? http://guides.rails.info/contrib... might be useful. Let me know if you need any help!

  • Thibaud Guillaume-Gentil

    Thibaud Guillaume-Gentil March 23rd, 2009 @ 07:28 PM

    Ok, I'll try to write a patch/test this week.

  • Thibaud Guillaume-Gentil

    Thibaud Guillaume-Gentil March 23rd, 2009 @ 08:04 PM

    Ok, it was an easy patch :-), here the diff file with the related test.

    I'm not sure if the 'if as' is useful in partials.rb, maybe it slow down the function but it's more secure no?, what do you think?

  • Jeremy Kemper

    Jeremy Kemper May 4th, 2010 @ 06:48 PM

    • Milestone changed from 2.x to 3.x
  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 04:42 PM

    • State changed from “new” to “open”
    • Importance changed from “” to “”

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 04:42 PM

    • State changed from “open” to “stale”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Pages