<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ria10</author_name>
  <author_url>https://blog.hatena.ne.jp/ria10/</author_url>
  <blog_title>リア充爆発日記</blog_title>
  <blog_url>https://ria10.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby on Rails</anon>
  </categories>
  <description>Railsのバリデーション機構を使っていると、エラーメッセージの表示がうまくない。 たとえばメールアドレスの入力バリデーションで、必須チェックとフォーマットチェックを以下のように入れたとする。 validates :email, presence: true, format: {with: VALID_EMAIL_REGEX} エラー出力のerbはこんな感じ。 &lt;% model.errors.full_messages.each do |msg| %&gt; &lt;li&gt;* &lt;%= msg %&gt;&lt;/li&gt; &lt;% end %&gt; で、この状態でメールアドレスの入力を空にすると、必須チェックにもフォーマットチ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fria10.hatenablog.com%2Fentry%2F20130625%2F1372146324&quot; title=&quot;Railsのバリデーションでエラーメッセージが重複するのを避けてみる - リア充爆発日記&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>2013-06-25 16:45:24</published>
  <title>Railsのバリデーションでエラーメッセージが重複するのを避けてみる</title>
  <type>rich</type>
  <url>https://ria10.hatenablog.com/entry/20130625/1372146324</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
