<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>y_hakoiri</author_name>
  <author_url>https://blog.hatena.ne.jp/y_hakoiri/</author_url>
  <blog_title>箱のプログラミング日記。</blog_title>
  <blog_url>https://www.y-hakopro.com/</blog_url>
  <categories>
    <anon>Rails</anon>
  </categories>
  <description>バリデーションに複数条件を指定したい タイトルの通り。 Railsではデータの入力漏れをユーザー側に知らせる手段としてバリデーションが用いられますが、条件によって処理を分けたい場合も当然出て来ますよね。 例えば私がスクールでやったメ◯カリで言うと、 出品する商品が衣服だったらサイズ入力必須とか、 ポートフォリオで作ったお弁当予約サイトで言うと デリバリー注文を選択した場合は配送先住所の入力必須とか。 そもそもバリデーションの書き方 この記事においてはそんなに需要ないかと思いますので、 リファレンスを参照してください。 Active Record バリデーション - Rails ガイド まず条件…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.y-hakopro.com%2Fentry%2F2019%2F10%2F29%2F213945&quot; title=&quot;Proc.newでバリデーションに複数条件を指定【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>https://cdn-ak.f.st-hatena.com/images/fotolife/y/y_hakoiri/20191102/20191102121704.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-10-29 21:39:45</published>
  <title>Proc.newでバリデーションに複数条件を指定【Rails】</title>
  <type>rich</type>
  <url>https://www.y-hakopro.com/entry/2019/10/29/213945</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
