I am trying to implement an invitation feature on my site. I am trying to display on each user’s page a list of the people they have invited. In my invitations controller I have the following code:
def index
@invitation = Invitation.new
@emails_for_invitations = Invitation.find_all_by_sender_id(current_user.id)
@referred_users = User.where(:referer => current_user.id)
end
In my invitation view I have the following code:
<h1>Sent Invitations</h1>
<ul>
<%= for invitation in @emails_for_invitations do %>
<li><%= invitation.recipient_email %></li>
<% end %>
</ul>
The output displayed on the site is as follows:

Why is the last line of the output occurring? I can’t seem to get rid of it. There is nothing in my controller or view that is calling on this to happen. All I want to see is the list of emails.
without the equals sign “=” will get rid of the output. The reason is you tell rails to render the return value of your
forloop, which happens to be each individual invitation object as it looks …