Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Use Rails Date_select Without Activerecord Model

DZone's Guide to

Use Rails Date_select Without Activerecord Model

·
Free Resource
// In your view:

<%= date_select('range', 'start_date', :order => [:month, :day, :year])%>


// In your controller:

@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/
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}