Skip to content

Instantly share code, notes, and snippets.

@1c7
Last active August 31, 2018 11:06
Show Gist options
  • Select an option

  • Save 1c7/4ab1422d57dcb752917d6be1563fbc36 to your computer and use it in GitHub Desktop.

Select an option

Save 1c7/4ab1422d57dcb752917d6be1563fbc36 to your computer and use it in GitHub Desktop.
Fix accidentally store base64 img into database
http://1c7.me/2018-8-31-fix-base64-img-in-database-to-url/
@1c7

1c7 commented Aug 31, 2018

Copy link
Copy Markdown
Author

Ruby

insert into db

def inser_into_db
    id = '434'
    content = '[内容填这里]'

    t = Topic.find(id)
    t.content_html = content
    t.save
    render json: "成功更新文章id #{id} 内容"
    return
end

@1c7

1c7 commented Aug 31, 2018

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment