<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>tanaken0515</author_name>
  <author_url>https://blog.hatena.ne.jp/tanaken0515/</author_url>
  <blog_title>tanaken’s blog</blog_title>
  <blog_url>https://tanaken0515.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>3行まとめ Rails でDBのデータを取得して json 形式に変換したい、というシーンにおいて to_json は ActiveSupport::ToJsonWithActiveSupportEncoder のメソッド to_json には as_json (ActiveModel::Serializers::JSON) のオプションが渡せる as_json のオプションはとても便利 単に json 形式に変換したい Rails でのアプリケーション開発において、取得してきたデータを json 形式に変換したいシーンはままあると思う。 そういう時は to_json が便利。 例えば nam…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftanaken0515.hatenablog.com%2Fentry%2F2020%2F04%2F24%2F231922&quot; title=&quot;Rails の to_json には便利なオプションを渡せるよ - tanaken’s blog&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-04-24 23:19:22</published>
  <title>Rails の to_json には便利なオプションを渡せるよ</title>
  <type>rich</type>
  <url>https://tanaken0515.hatenablog.com/entry/2020/04/24/231922</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
