<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>bigsize1860</author_name>
  <author_url>https://blog.hatena.ne.jp/bigsize1860/</author_url>
  <blog_title>コバルトブルーの心の叫び</blog_title>
  <blog_url>https://bigsize1860.hatenadiary.org/</blog_url>
  <categories>
    <anon>Rails</anon>
  </categories>
  <description>がっつりはまってしまった。Railsにはcollection_selectという便利なメソッドが存在する。 こいつは、form_forメソッド内にドロップダウンリストを作成する際に利用すると、オブジェクトからドロップダウンへの表示項目とform_forへと送る値とを任意に指定できる優れもの。 実際の利用はこんな感じ。 上記の例では、たとえばPublisher内に、nameが「小学館」「集英社」「講談社」、idは左から1,2,3というデータがあったとしたら、画面上には下のように表示される。 小学館 集英社 講談社 ここで「集英社」を選択すると、@bookのpublisher_idには 2 がセッ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fbigsize1860.hatenadiary.org%2Fentry%2F20100820%2F1282282854&quot; title=&quot;collection_selectでの初期値設定 - コバルトブルーの心の叫び&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>2010-08-20 14:40:54</published>
  <title>collection_selectでの初期値設定</title>
  <type>rich</type>
  <url>https://bigsize1860.hatenadiary.org/entry/20100820/1282282854</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
