I have a parent model, a child model and a join model. How does the controller of the join model look like if I need to reference the parent_id and the child_id?
For example, I have:
def new
@join = JoinModel.new
new
def create
@join = JoinModel.new(params[:join_model])
@parent_id = current_user.id
end
My question is, how do I reference the child model object?
If I use @child = Child.find(params[:id]), it gives me the error
can't find child without an ID`.
Help.
Thanks.