Rails Partial

2013年3月06日 22:33

Collection:

<%= render :partial => "common/post", :collection => @posts %>

Partials are very useful in rendering collections. When you pass a collection to a partial via the :collection option, the partial will be inserted once for each member in the collection

Object:

<%= render :partial => "customer", :object => @new_customer %>