1
0
Fork 0

Merge branch 'atomaka/feature/bulk-evidences' into 'master'

Bulk evidence uploading

Bulk evidence, needs a quick review.

See merge request !3
This commit is contained in:
Andrew Tomaka 2015-10-16 15:16:40 -04:00
commit 9e68871ef6
2 changed files with 6 additions and 8 deletions

View file

@ -8,13 +8,11 @@ class Admin::EvidencesController < Admin::BaseController
end
def create
@evidence = Evidence.new(evidence_params)
if @evidence.save
redirect_to admin_evidences_path, notice: 'Evidence was created'
else
render :new
params[:evidence][:screenshot].each do |screenshot|
Evidence.new(screenshot: screenshot).save
end
redirect_to admin_evidences_path, notice: 'Evidence was created'
end
def destroy

View file

@ -1,5 +1,5 @@
= simple_form_for [:admin, @evidence] do |f|
= simple_form_for [:admin, @evidence], html: { multipart: true } do |f|
.form-inputs
= f.input :screenshot, as: :file
= f.input :screenshot, as: :file, input_html: { multiple: 'multiple' }
.form-actions
= f.button :button