aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
diff options
context:
space:
mode:
authorChris Oliver <excid3@gmail.com>2019-03-30 11:54:47 -0500
committerChris Oliver <excid3@gmail.com>2019-03-30 12:15:17 -0500
commitecdcf06cb2e19e4bd2d883fbf3908cf196cfc1a5 (patch)
tree8903a538961ce8c85a7ef1c5fcbec11c4c18e38b /railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
parent4e076b03b6312b928a845f9a31288d10d7243338 (diff)
downloadrails-ecdcf06cb2e19e4bd2d883fbf3908cf196cfc1a5.tar.gz
rails-ecdcf06cb2e19e4bd2d883fbf3908cf196cfc1a5.tar.bz2
rails-ecdcf06cb2e19e4bd2d883fbf3908cf196cfc1a5.zip
Add attachment and attachments field generators
Diffstat (limited to 'railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt')
-rw-r--r--railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt3
1 files changed, 3 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt b/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
index b80c1280ce..1dddc3d698 100644
--- a/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
+++ b/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt
@@ -21,6 +21,9 @@
<div class="field">
<%%= form.label :password_confirmation %>
<%%= form.password_field :password_confirmation %>
+<% elsif attribute.attachments? -%>
+ <%%= form.label :<%= attribute.column_name %> %>
+ <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, multiple: true %>
<% else -%>
<%%= form.label :<%= attribute.column_name %> %>
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %> %>