need help with join / edit

Hi i have a issue here: Model: COMPANY Model: USER JOIN-MODEL: user_company

in the index view of the user i would like to have a second row per each user to insert a index / vire partial from the User-Company-Join relation:

user/index: <h1>Listing Users</h1>

<table border=1>   <tr>     <th>Firstname</th>     <th>Lastname</th>     <th>Username</th>   </tr>

<% for u in @users %>   <tr>     <td><%=h u.firstname + u.id.to_s %></td>     <td><%=h u.lastname %></td>     <td><%=h u.username %></td>     <td><%= link_to 'Show', u %></td>   </tr>     <td colspan=4><%=h render :partial =>'user_companies/edit', :local => @users %></td>   </tr> <% end %>

</table>

<br />

Just at a glance it looks like you should change @user_comp to
@user_company in user_companies/edit.

And as a tip if you don't have any additional fields to keep track of
in your user_company model, you should use a has_and_belongs_to_many
relationship.

-J.

hi, mh ur right, but still it complains about the variable im using in the partial... partial:

<% form_for(@users.companies) do |f| %>

undefined method `companies' for #<Array:0xb6c106a4>

what i wanna achivee is the join table between user and company. the rb's are ok.

thx tom