json.extract! @module, :id, :name, :position, :url mds = @module.competition_module_md_contents json.md_contents mds.each do |md| json.md_name md.name json.md_content md.content json.competition_stage_id md.competition_stage_id json.created_at md.created_at.strftime('%Y-%m-%d %H:%M:%S') json.attachments do json.array! md.attachments, partial: 'attachments/attachment_simple', as: :attachment end end