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:
Listing Users
Firstname | Lastname | Username | |
---|---|---|---|
<%=h u.firstname + u.id.to_s %> | <%=h u.lastname %> | <%=h u.username %> | <%= link_to 'Show', u %> | <%=h render :partial =>'user_companies/edit', :local => @users %> | <% end %>
user_company controller:
def edit
@user_company = UserCompany.find(params[:id])
end
user_companies / edit :
Editing user_division
<% form_for(@user_company) do |f| %>
<%= f.error_messages %>
Record ID:
<%= @user_comp.id %>
<%= f.submit "Update" %>
<% end %> --------------------------------------------------- its givin me : Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id all the time... please guys give me a hint...thx