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

Generate text data type as textarea #5784

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

acangiano
Copy link

Currently, mix phx.gen.html (and mix phx.gen.live) generate a single-line input field even if the user specifies text as the data type. For example:

mix phx.gen.html Blog Post posts title:string body:text

will generate the following form which is not what most users would expect.

Posts

In essence, there is no distinction between string and text types as far as the generated HTML goes (though, the distinction exists in the generated migration file).

This small patch allows for fields declared as text to be generated as <textarea>.

improved-posts

@acangiano
Copy link
Author

I removed the text example from the docs.

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 this pull request may close these issues.

2 participants