<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: collection code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sun, 27 Jul 2008 07:47:28 GMT</pubDate>
    <description>DZone Snippets: collection code</description>
    <item>
      <title>Using a mutiple collection select form helper with habtm or has many associations in Rails</title>
      <link>http://snippets.dzone.com/posts/show/4369</link>
      <description>// where user has and belongs to many roles&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;# in your view&lt;br /&gt;&lt;%= collection_select :user, :role_ids, Role.find(:all, :order =&gt; 'name ASC'), :id, :name, { :selected =&gt; @user.role_ids }, { :multiple =&gt; true, :name =&gt; 'user[role_ids][]' } -%&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Mon, 30 Jul 2007 08:58:54 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4369</guid>
      <author>davenolan (davenolan)</author>
    </item>
    <item>
      <title>each_slice</title>
      <link>http://snippets.dzone.com/posts/show/772</link>
      <description>&lt;code&gt;&lt;br /&gt;require 'enumerator'&lt;br /&gt;&lt;br /&gt;(1..10).each_slice(2) { |n| p n }&lt;br /&gt;# [1, 2]&lt;br /&gt;# [3, 4]&lt;br /&gt;# [5, 6]&lt;br /&gt;# [7, 8]&lt;br /&gt;# [9, 10]&lt;/code&gt;</description>
      <pubDate>Fri, 30 Sep 2005 16:50:45 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/772</guid>
      <author>nemostultae (Daniel)</author>
    </item>
  </channel>
</rss>
