错误"验证失败:Url此字段是必填字段!"什么时候用回形针创建附件?

时间:2017-01-19 04:11:49

标签: ruby-on-rails paperclip attachment

我的参数[附件]:

#<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">

当我创建时: Attachment.create!( document: params[attachments])

它显示错误:Validation failed: Url This field is required! 任何理想?谢谢你的帮助。

1 个答案:

答案 0 :(得分:1)

EXEC DBMS_UTILITY.compile_schema('SCHEMA_1', compile_all => false); 模型中,您可能会执行某些验证,例如Attachment