I used the following date_select
helpers but none of them shows a date select box with blank values selected by default. With all the following code, I get the select box but with the current date selected. I'm on Rails 2.3.2
<%= f.date_select :featured_at, :default => {:day => nil, :month => nil, :year => nil} %>
<%#= date_select("post", "featured_at", :prompt => { :day => 'Select day', :month => 'Select month', :year => 'Select year' }) %>
<%#= date_select("post", "featured_at", :default => { :day => nil }) %>
<%#= f.date_select :featured_at, :include_blank => true, :order => [:day, :month, :year] %>
Far easier to do this:
<%= f.date_select :featured_at, {:include_blank => true, :default => nil} %>
<%= f.label :expired %><br />
<%= f.datetime_select :expired,:prompt => { :day => 'Select day', :month => 'Select month', :year => 'Select year' } %>
works for me
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With