I have a team-table and model, and a user-tabel and model, and a
teams_userstable for the join.
I select a few users, collect them in a group, and want to save them as
So I suppose I save one team-record, and several join-table-records,
with the same team_id, and different user_ids.
I've used the depot-application from Agile as a starting point,
@group = find_group
@team = Team.new(params[:team])
session[:group] = nil
render :action => :checkout
group.items.each do |item|
li = TeamsUsers.from_group_item(item)
teams_users << li
li = self.new
li.team_id = group_item.id
li.user_id = group_item.id
The bit were I get an error is the line team_users << li in the
Team-bit, and I don't know why.
I know this is a newbie question, (I am one, so...) but the point is
that it seems difficult to find clear info about that.
Could anybody please help me out? Thanks in advance.