<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: association code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Fri, 25 Jul 2008 14:43:31 GMT</pubDate>
    <description>DZone Snippets: association 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>
  </channel>
</rss>
