Whats the proper way to render partials, with :collection or :locals?
People succeed in answering Don Miguel de los Platanos's questions 42% of the time (8 successes in 19 attempts).
Answers by: Rich Collins
It really depends on the situation. If you have a collection that you want to iterate over and render a partial for each item in the collection, :collection is nice as you save the hassle of having to write the each code:
render :partial => 'foo', :collection => @foos
instead of
@foos.each do |foo|
render :partial => 'foo', :locals => {:foo => foo}
end
thank you :D