You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/app/views/memos/index.json.jbuilder

30 lines
729 B

6 years ago
##
# memo_list: 帖子列表
# memo_count: 帖子总数
# hot_memos: 热门帖子
# hot_tags: 热门标签
# recommend_shixuns: 推荐实训
# current_user: 当前用户信息
# tidding_count: 消息数
# #
json.memo_list do
json.array! @memos do |memo|
json.partial! "memos/memo_list", locals: {memo: memo}
end
end
json.memo_count @memos_count
json.hot_memos do
json.array! @hot_memos do |hm|
json.(hm, :id, :subject, :language, :forum_id, :all_replies_count)
json.replies_count hm.all_replies_count
json.praise_count hm.praise_tread.praise_count
json.tag hm.tag_repertoires.map(&:name)
end
end
json.hot_tags @tags_info.map{|o| o.attributes.dup.except("cnt", "id")}