lessons

lessons
@lesson= Lesson.new(user_id:current_user.id,category_id:category.id)
words = category.words.order("RAND()").limit 20	
words.each do |word|
@lesson.user_answers.build word_id: word.id
end