Skip to content

Instantly share code, notes, and snippets.

View JonasNielsen's full-sized avatar

Jonas Bylov JonasNielsen

View GitHub Profile
<h1>Listing people</h1>
<table>
<% @enterprises.each do |ent| %>
<tr>
<th colspan="8"><%= ent.name %></th>
</tr>
class Enterprise < ActiveRecord::Base
has_many :branches
has_many :people, :through => :branches
end
class Branch < ActiveRecord::Base
has_many :people
belongs_to :enterprise
end
<h1>Listing people</h1>
<table>
<% @enterprises.each do |ent| %>
<tr>
<th colspan="8"><%= ent.name %></th>
</tr>