* Add a simple image uploader partial * Trigger Travis CI Co-authored-by: rhymes <rhymes@hey.com>
15 lines
725 B
Text
15 lines
725 B
Text
<div class="crayons-card p-6" data-controller="image-upload">
|
|
<h2 class="crayons-title mb-4">Upload an Image</h2>
|
|
<p class="mb-6">Quickly upload an image.</p>
|
|
<% # Multipart, remote forms are tricky, the data is actually sent in the Stimulus controller. %>
|
|
<%= form_with(url: image_uploads_path, multipart: true) do |f| %>
|
|
<div class="form-group">
|
|
<%= f.label(:image, "Image:") %>
|
|
<%= f.file_field "image", class: "form-control", required: true, data: { target: "image-upload.fileField" } %>
|
|
</div>
|
|
<%= f.submit "Upload", class: "btn btn-primary", data: { action: "image-upload#onFormSubmit" } %>
|
|
<% end %>
|
|
|
|
<div class="mt-4 d-none" data-target="image-upload.imageResult">
|
|
</div>
|
|
</div>
|