我正在使用Refile版本0.6.2
我有一个用于创建和更新模型的表格,并具有以下字段:
string paramInfo = "";
NameValueCollection pColl = Request.Params;
for(int i = 0; i <= pColl.Count - 1; i++)
{
paramInfo += "Key: " + pColl.GetKey(i);
string[] pValues = pColl.GetValues(i);
for(int j = 0; j <= pValues.Length - 1; j++)
{
paramInfo += "Value:" + pValues[j];
}
在某些情况下(并非总是如此),当在编辑模式下打开表单时,出现此错误:
= f.attachment_field :link_file, :presigned => true, :direct => true
我认为有效的案例附件和产生此ActionView::Template::Error (comparison of String with 104857600 failed):
11: %br
12: %br
13:
14: = f.attachment_field :link_file, :presigned => true, :direct => true
15:
16: .col-md-3
17: %br
app/views/shared/_link_file_upload.html.haml:14:in `_app_views_shared__link_file_upload_html_haml___2606377629433516144_70356040874000'
app/views/links/_form.html.haml:144:in `block in _app_views_links__form_html_haml___1668864317264937965_70356019861340'
app/views/links/_form.html.haml:1:in `_app_views_links__form_html_haml___1668864317264937965_70356019861340'
app/views/links/edit.html.haml:12:in `_app_views_links_edit_html_haml__1627631071712043509_70356020304140'
Rendered /Users/lucia/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/rescues/_source.erb (16.4ms)
Rendered /Users/lucia/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (5.4ms)
Rendered /Users/lucia/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.2ms)
Rendered /Users/lucia/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/layout (160.5ms)
错误的附件之间没有任何区别。
这是为发生错误的comparison
存储的数据:
link_file
这就是link_file_id: "62dcd7d293cecb23be9d3db381ad9bff6fc4bfba55954f25d0...", link_file_content_type: "application/zip", link_file_filename: "chefprofile_2019-04-24 (2).zip", link_file_size: "23294"
上的内容:
link.link_file
这是模型:
#<Refile::File:0x00007fbd360a8ef8 @backend=#<Refile::S3:0x00007fbd32309e08 @s3_options={:region=>"us-east-1", :access_key_id=>"key", :secret_access_key=>"secret"}, @s3=#<Aws::S3::Resource>, @access_key_id="key", @bucket_name="fandwimages", @bucket=#<Aws::S3::Bucket name="fandwimages">, @hasher=#<Refile::RandomHasher:0x00007fbd32309d18>, @prefix="store", @max_size=nil>, @id="62dcd7d293cecb23be9d3db381ad9bff6fc4bfba55954f25d01175c92ce1">
我将其存储在数据库中
class Link < ActiveRecord::Base
attachment :link_file
end
我真的不知道从哪里开始寻找调试工具,知道有什么问题吗?