简体   繁体   English

使用paperclip在Rails 2.3.5中上传文件

[英]File upload issue in Rails 2.3.5 using paperclip

I have a Rails 2.3.5 application which has file upload functionality using paperclip. 我有一个Rails 2.3.5应用程序,它使用paperclip具有文件上传功能。 When I upload a file, the first time everything works fine. 当我上传文件时,第一次一切正常。 But the second time I try I get the following error message: 但我第二次尝试时收到以下错误消息:

uninitialized constant ActiveSupport::MessageVerifier::Encoding

From the trace it looks like an issue with form_authenticity_token. 从跟踪中看起来像form_authenticity_token的问题。

<% form_for @import, :html => {:multipart => true} do |f| -%>
    <ul>
        <li><%= f.label :source, "Select a file to import" %></li>
        <li><%= f.file_field :source %></li>

        <%= submit_tag 'Submit' -%>         
    </ul>
<% end -%>

If I clear the browser cache, I can get it working again. 如果我清除浏览器缓存,我可以让它再次运行。 So I guess this is something related to session/tempfile etc. I just dont know what exactly :) Is there something I am missing here? 所以我想这是与session / tempfile等相关的东西。我只是不知道究竟是什么:)这里有什么我想念的吗? Any help is appreciated 任何帮助表示赞赏

Thanks, Abhilash 谢谢,Abhilash

可能与这个固定的票证https://rails.lighthouseapp.com/projects/8994/tickets/3666-messageverifier-and-rails-235-with-ruby-187有关 ,升级您的rails可能会将其排除。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM