<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>w6500</author_name>
  <author_url>https://blog.hatena.ne.jp/w6500/</author_url>
  <blog_title>tanihiro.log</blog_title>
  <blog_url>https://tanihiro.hatenablog.com/</blog_url>
  <categories>
    <anon>ruby</anon>
    <anon>rails</anon>
  </categories>
  <description>RailsでFormを扱う時は、Modelと紐付けることで、validationなどの設定はModelに書くことができ、非常に便利です。 ですが、DBと関係ない場合は紐付ける対象のModelが生成されていません。 そこで使用するのがActiveModelです。 https://github.com/rails/rails/tree/master/activemodel 使い方 使い方は簡単で、既存のModelと同じように扱うことができます。 Modelクラスの作成 まずは、Formのプロパティを持ったModelクラスを作成します。 このクラスはActiveModel::Modelをinclud…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftanihiro.hatenablog.com%2Fentry%2F2014%2F01%2F09%2F193720&quot; title=&quot;【ruby】ActiveModelを使ってDBと関係ないFormを作成する【Rails】 - tanihiro.log&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>2014-01-09 19:37:20</published>
  <title>【ruby】ActiveModelを使ってDBと関係ないFormを作成する【Rails】</title>
  <type>rich</type>
  <url>https://tanihiro.hatenablog.com/entry/2014/01/09/193720</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
