<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: Davenolan's Code Snippets</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sun, 27 Jul 2008 02:40:41 GMT</pubDate>
    <description>DZone Snippets: Davenolan's Code Snippets</description>
    <item>
      <title>Use rails date_select without activerecord model</title>
      <link>http://snippets.dzone.com/posts/show/4630</link>
      <description>// In your view:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;%= date_select('range', 'start_date', :order =&gt; [:month, :day, :year])%&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;// In your controller:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;@start_date = Date.civil(params[:range][:"start_date(1i)"].to_i,params[:range][:"start_date(2i)"].to_i,params[:range][:"start_date(3i)"].to_i)&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Credit: http://www.jonsthoughtsoneverything.com/2006/05/21/how-to-access-date_select-without-an-active-record-model/</description>
      <pubDate>Wed, 10 Oct 2007 12:42:58 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4630</guid>
      <author>davenolan (davenolan)</author>
    </item>
    <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>
