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/db/migrate/20190805010545_modify_ke_co...

19 lines
599 B

class ModifyKeContentsForMarkdown < ActiveRecord::Migration[5.2]
# include ActionView::Helpers::SanitizeHelper
def change
# def ke_transform_to_md content
# sanitize(content, tags: %w(img a span), attributes: %w(src href target style))
# .gsub(/^(\n)/, "").gsub(/(\n)+/, "<br />").gsub(/$(\n)/, "")
# .gsub(/(\n)+/, "<br />").gsub("\t", "&nbsp;&nbsp;&nbsp;&nbsp;")
# end
#
# MessageDetail.find_each do |m|
# content = ke_transform_to_md m.content
# puts("content:#{content}")
# m.update_column(:content, content)
# end
end
end