In my application i am creating a form which uploads multiple document. Now i have posted the form with 2 upload documents but not able to save in the database due to the error. But I am getting all the parameters as mentioned above. Please help me out to solve this issue.
In controller:
def create
@sr_document = SrDocument.new(sr_document_params)
end
def sr_document_params
params.require(:sr_document).permit(:file_type, :file, :service_request_id, :file_file_name, :file_content_type, :file_file_size)
end
In log:
"sr_document"=>{"file"=>[
@tempfile=#, @original_filename="Reliance Web-Chat.pdf", @content_type="application/pdf", @headers="Content-Disposition: form-data; name=\"sr_document[file][]\"; filename=\"Reliance Web-Chat.pdf\"\r\nContent-Type: application/pdf\r\n">,
@tempfile=#\, @original_filename="Flipkart.pdf", @content_type="application/pdf", @headers="Content-Disposition: form-data; name=\"sr_document[file][]\"; filename=\"Flipkart.pdf\"\r\nContent-Type: application/pdf\r\n">
]}
fileis a field insr_documentstable? can you show us theform? - Sonalkumar sute