date_select does not select the prompt option when it is set #5111

Closed
davidmles opened this Issue Feb 21, 2012 · 5 comments

Comments

Projects
None yet
2 participants

If you set date_select like this:

<%= f.date_select :birthday, prompt: true %>

… generic prompt will be added but will not be selected by default. Shouldn't it?

The only way I have found to select the prompt automatically is setting the birthday field to nil in the controller. Don't you think this should be the default behavior?

Owner

rafaelfranca commented Feb 22, 2012

I don't think so. If the birthday has a value this value should be the selected.

In the controller I only have this:

@user = User.new

Then in the view I have the date_select. This way the selected value is: "year-01-01", but I think it should be "year-month-day".

Owner

rafaelfranca commented Feb 23, 2012

I tried here and when I did:

<%= f.date_select :created_at, prompt: true %>

In an empty article it showed the three prompts.

Could you send an example application?

Owner

rafaelfranca commented Apr 30, 2012

I'm closing this issue now since I couldn't reproduce the issue.

If you still have this issue, please provide an example application, a test case or a pull request if you want, and reopen this issue.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment