From 95e7c215df89608a5b10bebb87968c9a713bbf3d Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Tue, 17 Oct 2023 15:05:36 -0400 Subject: Added uploading images to blog posts --- app/views/admin/blogs/_form.html.haml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/views/admin/blogs') diff --git a/app/views/admin/blogs/_form.html.haml b/app/views/admin/blogs/_form.html.haml index 625c85e..c3720ba 100644 --- a/app/views/admin/blogs/_form.html.haml +++ b/app/views/admin/blogs/_form.html.haml @@ -39,4 +39,12 @@ = builder.label :_destroy, "Create record?" .record-description-field = builder.text_area :description, placeholder: "record text" + .details-module.image-uploads + %h4 Images + - f.object.images.each do |image| + = image_tag image.variant(:thumb) + = f.hidden_field :images, multiple: true, value: image.signed_id + %pre= url_for image + %hr + = f.file_field :images, multiple: true .details-module= f.submit -- cgit 1.4.1