In order to avoid to bore the list with more trivial questions (like these
two), can you please suggest some readings ?
I read about the upcoming book, which I will probably buy; is there anything
else apart the "raw" documentation ?
Reading here and there I undestood that there must be a way to optimize a
piece of code like this:
<% for duty in @duties %>
<% for user in duty.users %>
<tr>
<td><%= user.name %></td>
</tr>
<% end %>
<% end %>
This is the model:
class Duty < ActiveRecord::Base
belongs_to :type
has_and_belongs_to_many :users
end
class User < ActiveRecord::Base
has_and_belongs_to_many :duties
end
Many thanks in advance.
Bruno