Rails 3 - tables in html.erb

Viewed 15644

I'd like to view data from different database-tables in a view with tables like this picture shows:enter image description here

I'm familiar with HTML tags <table>, <td> and <tr>, but I'm having trouble with multiple queries in a column.

<table>
  <tr>
    <th>Skills &nbsp; &nbsp; &nbsp;</th>
    <th>Expected-qualifications</th>
    <th>Current-qualifications</th>
  </tr>

   <% @employee.position.skills.each do |skill| %><% @employee.position.expected_qualifications.each do |expected_qualification| %><% @employee.current_qualifications.each do |current_qualification| %>
  <tr>
    <td><%= skill.kategorien %></td>
    <td><%= expected_qualification.sollqualifikation %></td>
    <td><%= current_qualification.istqualifikation %></td>
  </tr>
  <% end %><% end %><% end %>

</table>

This code looks like this:

enter image description here

As you can see, the skills, expected-qualifications, and current-qualifications repeat.

My question: How should the codes be ordered in the table so it will look the way I want it to?

2 Answers
Related