mindpin / eshare

目前的主站项目。
4 stars 2 forks source link

markdown course_ware #225

Open fushang318 opened 11 years ago

fushang318 commented 11 years ago

创建

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)