Reputation: 53
My params[attachments]:
#<ActionDispatch::Http::UploadedFile:0x007ff89bac0990 @tempfile=#<Tempfile:/tmp/RackMultipart20170119-25970-6hvs90.jpg>, @original_filename="ca.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"job_application[attachments]\"; filename=\"ca.jpg\"\r\nContent-Type: image/jpeg\r\n">
And when i create by:
Attachment.create!( document: params[attachments])
It show me error: Validation failed: Url This field is required!
Any ideal? Thanks for any help.
Upvotes: 0
Views: 61
Reputation: 3018
In your Attachment
model you are likely performing some validation like validates_presence_of :url
Upvotes: 1