I have a users table. I have a assignment table. and I have to log in
to see my assignments. i can and I hasve a session id.
I can make a new assignment and save my id in the user_id field of the
I want to share my assignments. so I can create a assignments_users
table. this way I can have assignment 1 shared with user 1 and 2. and
If I log in as user 1 or 2 I see the assignment.
so assignement table has these fields for simplicity
this is where I have problems thinking.
how do get my session id to save into the assignments_users table with
the id of the new assignment I just created?
old create when saving session id to the assignment table
params[:assignment][“user_id”] = session[:userid]
flash[:notice] = ‘assignment was successfully created.’
redirect_to :action => ‘index’
render :action => ‘new’
Am I going about this wrong? should I use something else has_many =>
if I put the numbers in the assignments_users everything works fine. I
feel not smart.
i’ve read most of AWDR, I’m half way through ruby for rails (which has
really helped) and googled.
so if there something in the books I’m missing point me to it and I’ll