Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

davenolan http://textgoeshere.org.uk

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Use rails date_select without activerecord model

// In your view:
   1  
   2  <%= date_select('range', 'start_date', :order => [:month, :day, :year])%>


// In your controller:
   1  
   2  @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)


Credit: http://www.jonsthoughtsoneverything.com/2006/05/21/how-to-access-date_select-without-an-active-record-model/
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS