Forum: Ruby on Rails Basic question about partials

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Richard D. (Guest)
on 2005-12-11 03:48
I'm new to Rails and working through the Agile Web Dev w\Rails book
(which is great by the way).  My question is:  Do partials iterate by
default?  For example,   in Chapter 10 of the before mentioned book, the
author introduces partials and basically codes an HTML table row
populated with ruby objects.  This code (partial) then goes into the
HTML table but nowhere in the code (partial or view) do I see any
iteration code.  Like I say, I'm new and I'm trying to figure out how
the 'magic' happens.  How does rails take one HTML row and repeat it
throughout a table?  Does rails iterate through the ':collection'
repeating rows as long as there is data in the ':collection'?

Thanks for any help in advance!
ksruby (Guest)
on 2005-12-11 04:08
(Received via mailing list)
Yes. :P

Check out actionpack/lib/action_view/partials.rb and
render_partial_collection
method.

Kent.
This topic is locked and can not be replied to.