<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>Oratok</author_name>
  <author_url>https://blog.hatena.ne.jp/Oratok/</author_url>
  <blog_title>Rails つまみぐい</blog_title>
  <blog_url>https://rails.hatenadiary.jp/</blog_url>
  <categories>
  </categories>
  <description>Ruby on Rails v3.2.11 プルダウンメニュー（select_tag）の選択肢を決め打ちでやらず、マスタとしてDB内のテーブルに用意する場合のやり方です。collection_select を使います。 ここでは例として、都道府県名を格納するために prefecture テーブルと Prefecture モデルを作成します。 |id |name | | 1|北海道 | | 2|青森県 | | 3|岩手県 | ...(以下省略)このテーブルの中身をプルダウンメニューの選択肢として利用するには以下のように書きます。 &lt;%= form_for @user do |f| %&gt; &lt;%= …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Frails.hatenadiary.jp%2Fentry%2F2013%2F03%2F15%2F122116&quot; title=&quot;プルダウンメニュー（select_tag）の中身をデータベースに用意する - 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-03-15 12:21:16</published>
  <title>プルダウンメニュー（select_tag）の中身をデータベースに用意する</title>
  <type>rich</type>
  <url>https://rails.hatenadiary.jp/entry/2013/03/15/122116</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
