lkahtz
lkahtz

Reputation: 4796

rails view display the unwanted activerecord instance info

My code in the view file is:

<%= @tweets.each do |tweet|%>
    <%= tweet.content %><br>
<% end %>   

It always display, besides the tweet.content field, like follows:

My tweet text...
#<Tweet:0x10368d018>

What is wrong?? How to get ride of the second line?

Upvotes: 0

Views: 127

Answers (1)

seeingidog
seeingidog

Reputation: 1206

Looks like you are rendering the expression in the first line. Try this:

<% @tweets.each do |tweet|%>
   <%= tweet.content %><br>
<% end %>   

Upvotes: 2

Related Questions