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

Would it be possible to add a function to support array type from Ecto? #214

Closed
x-ji opened this issue May 6, 2018 · 1 comment
Closed

Comments

@x-ji
Copy link

x-ji commented May 6, 2018

Ecto.Schema provides the array type. However, currently it's not straightforward to generate form input for such a type. Manual conversion might be needed between the raw form input and the array type. Somebody came up with a few functions that generate inputs. Would it be possible to have such a function in the official Phoenix.HTML module, or would it be impractical since the length of array is dynamic and thus will likely involve JavaScript?

@josevalim
Copy link
Member

Arrays are tricky because they could be handled in many different ways. In some cases, a select is enough. But in other cases, you may want something more dynamic. In such cases, using external functions is fine. Our focus here is to mostly wrap around what HTML provides out of the box.

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

No branches or pull requests

2 participants