I am trying to display the columns of a model as part of a table that shows the results of a query. I want to do this dynamically with an each loop in Ruby.
<table>
<tr>
<%= Terminology.column_names.each do |c| %>
<th> <% c.humanize %> </th>
<% end %>
</tr>
</table>
When I display this, it shows 30 or so empty header tags, then the array of column names is put between the last header and the end of the row. What is going on here?