json.course do json.partial! "polls/course_name",locals:{course:@course} end json.poll do json.extract! @poll,:id,:polls_name,:polls_description,:end_time json.user_poll_status @user_poll_status #当前用户的状态 json.left_banner_id @left_banner_id json.left_banner_name @left_banner_name json.poll_status @poll_status end json.question_answered @answer_status json.question_types do json.q_counts @poll_questions_count json.q_singles @poll_question_singles json.q_doubles @poll_question_doubles json.q_mains @poll_question_mains json.user_name @answer_user.real_name end json.questions do json.array! @poll_questions do | question| json.partial! "poll_votes/poll_votes",question: question, #问题 answers:question.poll_answers, #问题的答案选项 votes:@answer_user.poll_votes.find_current_vote("poll_question_id",question.id) #问题的答案 end end