This gives me the current date as the default. It is my understanding
(or misunderstanding) that adding the :include_blank => true will
default the values to blanks. But it doesn’t seem to be doing that.
Although including this option does allow me to select a blank value.
Just not defaulting to blanks, which is what I’m trying to accomplish.
I was thinking I had to put a nil there but didn’t managed to figure
out how to do it. I was using a plain “” which didn’t work obviously.
I didn’t think of just using the nil variable.
Not sure if the difference is the order of the args, or the fact that
I’m calling date_select vs. your select_date. (What’s the difference
between those 2 helpers?)
I believe date_select requires that you specify an object and the
method as in:
date_select(object_name, method, options={})
whereas select_date only needs a variable such as:
select_date( variable, option={})
when you use f.date_select you have already defined the object
beforehand, ( Example: <% form_for @object do |f| ), and hence
your :start_date is the method for your object f. You get the blank
result because your :start_date is presumably nil in the beginning.
Not sure of that answers your question or make it more confusing.
Steve
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.