Hi All,
I am trying to make use of the new render partial functionality where
in the index view I have
<%= render :partial => @people%> #in rails 2.0 it detects this as a
collection
and in the show
<%= render :partial => @person%> #in rails 2.0 it detects this as an
object
The _person.html.erb partial is
However I would like in the index view to add links to show or
destroy and in the show view add an edit link.
I tried to use the new layout for partials feature
<%= render :partial => @people, :layout => ‘index’%>
<%= render :partial => @people, :layout => ‘show’%>
where the _index.html.erb contained the show and destroy links and the
_show.html.erb contains the edit link. However for the layout it only
seems to be rendered once for a collection not once for each object in
the collection. Am I doing something wrong or is there a neat way
round this.
Thanks
Anthony