1

I am trying to iterate through a set of records. However, at the end of the iteration, rails displays the full array.

<%= @portfolio_item.technologies.each do |technology| %>
  <p><%= technology.name %></p>
<% end %>

What shows up in the browser enter image description here

Clement
  • 4,491
  • 4
  • 39
  • 69

1 Answers1

6

Replace this line

<%= @portfolio_item.technologies.each do |technology| %>

with this

<% @portfolio_item.technologies.each do |technology| %>

<%= %> will evaluate the expression and returns the array.

Nandu Kalidindi
  • 6,075
  • 1
  • 23
  • 36