<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>tabakazu</author_name>
  <author_url>https://blog.hatena.ne.jp/tabakazu/</author_url>
  <blog_title>たばりばりスタイル</blog_title>
  <blog_url>https://tabakazu.hateblo.jp/</blog_url>
  <categories>
  </categories>
  <description>ActiveModel::Errors クラスの to_hash のメソッドで引数を true にすることで良い感じに作ることができそうでした。あなた引数渡せるのね！ account = Account.new(email: &quot;invalid&quot;, password: &quot;&quot;) # 無効な値を入れる account.valid? account.errors.to_hash # 引数なし # =&gt; {:email=&gt;[&quot;は不正な値です&quot;], :password=&gt;[&quot;を入力してください&quot;]} account.errors.to_hash(true) # 引数あり # =&gt; {:email=&gt;[&quot;メ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftabakazu.hateblo.jp%2Fentry%2F2023%2F02%2F27%2F021155&quot; title=&quot;RailsでAPIのバリデーションエラーレスポンスに使いやすそうなjsonを作る - たばりばりスタイル&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>2023-02-27 02:11:55</published>
  <title>RailsでAPIのバリデーションエラーレスポンスに使いやすそうなjsonを作る</title>
  <type>rich</type>
  <url>https://tabakazu.hateblo.jp/entry/2023/02/27/021155</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
