Date_select in a partial


Currently I have a date_select in a form partial. This partial is
rendered by the edit and new form-actions.

But the problem is that when I go into the new page and save the form
it automaticly selects the current date. Actually I want that with the
new action the selected date are empty values (:include_blank) and
when Im in the edit form I want him to extract the values from the
data given (if nil > show empty entries).

What is the most elegant approach for this?

Kind regards,
Don P.

if you use form helper date_select(:object, :attr) then rails should
pull it out of the object by default as with other form helpers. Could
you post the code?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs