<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>moritamorie</author_name>
  <author_url>https://blog.hatena.ne.jp/moritamorie/</author_url>
  <blog_title>Composable Life</blog_title>
  <blog_url>https://blog.moritamori.net/</blog_url>
  <categories>
    <anon>ActiveModel</anon>
    <anon>rails</anon>
  </categories>
  <description>利用ケースは少ないと思いますが、ActiveRecord::Base を継承しないフォームと date_select や date_time_select を使ったビューの組み合わせだと、フォーム初期化時に UnknownAttributeError が発生していて、原因と対処方法がよく分からず若干ハマってしまったので誰かのためにメモで書いておきます。 前提 Ruby on rails 5.2.3 UnknownAttributeErrorが発生する原因 以下のようにdate_select や date_time_select を使ってビューを実装します。 - # app/views/plan…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.moritamori.net%2Fentry%2Frails-attribute-assignment&quot; title=&quot;【Rails】ビューに date_select や date_time_select を使ったフォームで UnknownAttributeError が発生する場合の対処 - Composable Life&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/m/moritamorie/20190912/20190912182516.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-09-12 19:00:34</published>
  <title>【Rails】ビューに date_select や date_time_select を使ったフォームで UnknownAttributeError が発生する場合の対処</title>
  <type>rich</type>
  <url>https://blog.moritamori.net/entry/rails-attribute-assignment</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
