<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ayaketan</author_name>
  <author_url>https://blog.hatena.ne.jp/ayaketan/</author_url>
  <blog_title>ayaketanのプログラミング勉強日記</blog_title>
  <blog_url>https://ayaketan.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>ユーザーをグループ分けするときに、そのグループに所属するユーザーをチェックボックスで選択したい。複数のチェックボックスの入力結果を処理するときに、不要な&quot;0&quot;が取得できてしまったので、メモ。まずは、ビューでチェックボックスを実装 &lt;% @users.each do |user| %&gt; &lt;%= f.check_box :user_id, {:name =&gt; &quot;grouping[user_id][]&quot;}, user.id %&gt; &lt;%= f.label :user_id, user.name, :value =&gt; user.id %&gt; &lt;br&gt; &lt;% end %&gt; すると、HTMLは次のようになった…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fayaketan.hatenablog.com%2Fentry%2F2014%2F01%2F30%2F114146&quot; title=&quot;Rails4 複数のチェックボックスの入力結果を配列で取得すると、不要な&amp;quot;0&amp;quot;が含まれる - ayaketanのプログラミング勉強日記&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-30 11:41:46</published>
  <title>Rails4 複数のチェックボックスの入力結果を配列で取得すると、不要な&quot;0&quot;が含まれる</title>
  <type>rich</type>
  <url>https://ayaketan.hatenablog.com/entry/2014/01/30/114146</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
