LoginSignup
dfgsdgfsd
@dfgsdgfsd

Are you sure you want to delete the question?

Leaving a resolved question undeleted may help others!

Editor.jsのデータをRailsで保存したい。

解決したいこと

Editor.jsのデータをRailsで保存したい。

Next.jsとRailsでwebアプリケーションを作成しております。
記事投稿システムを実装したいと考え、Next.jsでEditor.jsを使用し、Railsを用いてデータベースに記事データを保存したいと考えております。

そこで、「データをどのように保存したらいいのか?」という点で悩んでおります。アドバイスをいただけると幸いです。

記事データ


blocks: [
    {
      type: "header",
      data: {
        text: "Editor.js",
        level: 2
      }
    },
    {
      type: "paragraph",
      data: {
        text:
          "Hey. Meet the new Editor. On this page you can see it in action — try to edit this text."
      }
    },

考えられる方法

  • プロパティ名に対応するカラムを全て作成して、ループ処理を行い保存
  • base64でエンコードをして保存
0

1Answer

Comments

  1. @dfgsdgfsd

    Questioner
    ご回答いただきありがとうございます。
    参考にさせていただきます!

Your answer might help someone💌