mindpin/eshare

markdown course_ware

Opened this issue · 0 comments

创建

course_ware = CourseWare.create!({
  :title   => 'title',
  :desc    => 'desc',
  :chapter => chapter,
  :creator => creator,
  :markdown => "markdown string"
  },
  :as => :markdown
)

更新

course_ware.markdown = "markdown string"
course_ware.save

获取原始内容

course_ware.markdown

获取替换了外链图片的内容

course_ware.markdown(:replace_outer_url => true)