You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
635 B
26 lines
635 B
class BulkUploadController < ApplicationController |
|
before_action :authenticate_user! |
|
|
|
def show |
|
@bulk_upload = BulkUpload.new(nil, nil) |
|
render "case_logs/bulk_upload" |
|
end |
|
|
|
def bulk_upload |
|
file = upload_params.tempfile |
|
content_type = upload_params.content_type |
|
@bulk_upload = BulkUpload.new(file, content_type) |
|
@bulk_upload.process(current_user) |
|
if @bulk_upload.errors.present? |
|
render "case_logs/bulk_upload", status: :unprocessable_entity |
|
else |
|
redirect_to(case_logs_path) |
|
end |
|
end |
|
|
|
private |
|
|
|
def upload_params |
|
params.require("bulk_upload")["case_log_bulk_upload"] |
|
end |
|
end
|
|
|