Skip to content

Instantly share code, notes, and snippets.

@1c7
Last active August 31, 2018 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1c7/4ab1422d57dcb752917d6be1563fbc36 to your computer and use it in GitHub Desktop.
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
Copy link
Author

1c7 commented Aug 31, 2018

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
Copy link
Author

1c7 commented Aug 31, 2018

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