Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to use select_date #39

Open
eltonlk opened this issue Jul 23, 2015 · 1 comment · May be fixed by #50
Open

Trying to use select_date #39

eltonlk opened this issue Jul 23, 2015 · 1 comment · May be fixed by #50

Comments

@eltonlk
Copy link

eltonlk commented Jul 23, 2015

I have a form with the object located, I'm trying to use a select_date, but it gives the error below:

undefined method `change' for "23/07/2015":String

actionview (4.2.3) lib/action_view/helpers/date_helper.rb:832:in set_day_if_discarded' actionview (4.2.3) lib/action_view/helpers/date_helper.rb:722:inselect_date'
actionview (4.2.3) lib/action_view/helpers/tags/date_select.rb:14:in render' actionview (4.2.3) lib/action_view/helpers/date_helper.rb:258:indate_select'
actionview (4.2.3) lib/action_view/helpers/date_helper.rb:1070:in date_select' simple_form (3.1.0) lib/simple_form/inputs/date_time_input.rb:10:ininput'
simple_form (3.1.0) lib/simple_form/wrappers/leaf.rb:19:in call' simple_form (3.1.0) lib/simple_form/wrappers/leaf.rb:19:inrender'
simple_form (3.1.0) lib/simple_form/wrappers/many.rb:28:in block in render' simple_form (3.1.0) lib/simple_form/wrappers/many.rb:26:ineach'
simple_form (3.1.0) lib/simple_form/wrappers/many.rb:26:in render' simple_form (3.1.0) lib/simple_form/wrappers/root.rb:15:inrender'
simple_form (3.1.0) lib/simple_form/form_builder.rb:115:in input' app/views/monthly_payments/_form.html.haml:19:inblock (2 levels) in _app_views_monthly_payments__form_html_haml___3912999882345024763_70273144530800'

have a way to do this?

@sobrinho
Copy link
Contributor

@carlosantoniodasilva you can close this due to the lack of activity.

Just for reference, if you are going to use date_select, you must do this way:

 f.date_select :released_at, selected: @product.released_at

In case you don't have the original object, you can use this way (after #50 got merged):

 f.date_select :released_at, selected: @localized.unlocalize.released_at

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants