我在用着邮递员 https://github.com/ging/mailboxergem,我不知道如何将它与 Paperclip (消息类)一起使用。
将 Paperclip 与 User 类一起使用是:
class User < ActiveRecord::Base
has_attached_file :picture
end
如何将 has_attached_file 添加到 Message 类(模型中没有 message.rb)?
谢谢。
两种解决方案:
在初始化程序中执行以下操作:
Message.class_eval do
#your paperclip code goes here
end
并且不要忘记迁移 http://github.com/ging/mailboxer/blob/master/db/migrate/%E2%80%A6!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)