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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add attachment and attachments field generators #35805

Merged
merged 1 commit into from Apr 2, 2019
Merged

Add attachment and attachments field generators #35805

merged 1 commit into from Apr 2, 2019

Conversation

excid3
Copy link
Contributor

@excid3 excid3 commented Mar 30, 2019

Adds two new field generators for models attachment and attachments which will generate has_one_attached and has_many_attached in models.

It also generates file fields for each, adding multiple: true to has_many_attached, and renders links to the files on the show action.

Hopefully this makes it a lot easier for people to get started using ActiveStorage and ActionText. 馃憤

This is similar to the addition of the rich_text field generators added in #35781.

@rafaelfranca rafaelfranca merged commit 6c6c579 into rails:master Apr 2, 2019
y-yagi added a commit to y-yagi/jbuilder that referenced this pull request Apr 4, 2019
The params generation was cut out to a method in rails/rails#35805.
This is to handle the attachments field.

So use the method in jbuilder as well. Without this, a permit to handle
arrays is not generated if attachments field is specified.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants