I want to get the object the child node is referering to, so I can make a query.
My code looks like this:
child @course_types => :course_types do |course_type|
attributes :id, :name, :deleted
child CourseTypeCategory.where(course_type: course_type, active: true) => :category_position do
attributes :category_id, :position
end
end
The result of this query CourseTypeCategory.where(course_type: course_type, active: true) is always returning the same result as if course_type was always the same each type it is rendered (in this case I suspect is always the first object of @course_types). Is there a way to get the "current object" of the child and make a query like if you were doing a loop (like an each do)?
Thanks in advance and sorry if the question is confusing.
Try this.
Sorry for so little information on this, I'm kind in a hurry.