view - Iterative display of objects in Rails -


i find when iteratively render collection of objects, say, comments, rails lists addresses of objects. example, view may contain following:

<h3>comments</h3> <% if @blogpost.comments.any? %>   <%= @blogpost.comments.each |comment| %>     <%= render :partial => "comment", :locals => {:comment => comment} %>   <% end %>   <% end %> 

the view shows this:

<h3>comments</h3>    <p>comment #2</p>    <p class="post-info"> >> example user,  1 hour ago. </p>     <p>this user 1's comment on user 5's article</p>    <p class="post-info"> >> example user,  2 days ago. </p>   #&lt;comment:0xb6f91968&gt;#&lt;comment:0xb6f9016c&gt; 

as can see, there couple of address listings objects, prefer not have in view. there way suppress output? in advance time!

remove = <%= @blogpost.comments.each |comment| %>

when add = in <% %> rails execute erb code , render output in html.


Comments

Popular posts from this blog

Cursor error with postgresql, pgpool and php -

c# - how to write client side events functions for the combobox items -

ssh client with paramiko (python) -