Bulk evidence uploading
This commit is contained in:
parent
d16bb6e03b
commit
dd42725402
2 changed files with 6 additions and 8 deletions
|
@ -8,13 +8,11 @@ class Admin::EvidencesController < Admin::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@evidence = Evidence.new(evidence_params)
|
params[:evidence][:screenshot].each do |screenshot|
|
||||||
|
Evidence.new(screenshot: screenshot).save
|
||||||
if @evidence.save
|
|
||||||
redirect_to admin_evidences_path, notice: 'Evidence was created'
|
|
||||||
else
|
|
||||||
render :new
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
redirect_to admin_evidences_path, notice: 'Evidence was created'
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
= simple_form_for [:admin, @evidence] do |f|
|
= simple_form_for [:admin, @evidence], html: { multipart: true } do |f|
|
||||||
.form-inputs
|
.form-inputs
|
||||||
= f.input :screenshot, as: :file
|
= f.input :screenshot, as: :file, input_html: { multiple: 'multiple' }
|
||||||
.form-actions
|
.form-actions
|
||||||
= f.button :button
|
= f.button :button
|
||||||
|
|
Loading…
Reference in a new issue