Hi I have a block that I need to nest another block in. Or maybe I don't and I am doing this totally wrong. There is a UNIT and the UNIT has_many COMPANIES Then COMPANIES has_many USERS
on the UNIT show page I am trying to do something like this:
<% @company.each do |c|%>
<%= c.name %>
<% ??? each do |f| %>
<p>
Name: <%= f.name %>
</p>
<% end %>
<% end %>
So basically for each Company I show the name of the Company, no problem there, but then I am trying to show that within each company there are particular Users I am listing that belong to that company. I can't define that in the controller because there are multiple companies.
That user is: cc = @user.find(:all, :conditions => ["position = ?", "Company Commander"])
I am not sure how to loop through for each Company and then for that Company loop through and list a particular user for that company.
Sorry if I did a poor job of explaining this. I am not sure if this is even the right way to be doing this.
Thanks in advance.