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

bugfix: f.text_field does not display array #697

Merged
merged 2 commits into from
Mar 23, 2020

Conversation

yohm
Copy link
Member

@yohm yohm commented Mar 23, 2020

fixed #696 Thanks @noda50

When the default value of an object parameter is an array (such as [1,2,3]), the default value is not properly displayed in the form.
This is because text_field method changes its behavior when the object is an array. We explicitly call to_json and set it to the value of the form to avoid this issue.
https://apidock.com/rails/ActionView/Helpers/FormHelper/text_field

image

When the default value of a parameter is an array,
the default value is not properly displayed by `f.text_field` method.
We explicitly call `to_s` and set it to the value of the form.
@yohm yohm added the bug label Mar 23, 2020
@yohm yohm added this to the v3.9.0 milestone Mar 23, 2020
@yohm yohm self-assigned this Mar 23, 2020
@yohm yohm merged commit 89a4c8d into develop Mar 23, 2020
@yohm yohm deleted the bugfix_array_is_not_properly_displayed branch March 23, 2020 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simulator を duplicate する時に Object 型の parameter の default が消える
1 participant