inline-attachments

Cannot add inline attachment with actionmailer in rails 3

坚强是说给别人听的谎言 提交于 2019-12-11 11:13:52
问题 After a bundle install I am no longer able to add inline images to attachments. This is the error I get: NoMethodError (undefined method `type_for' for MIME::Types:Class): app/mailers/welcome_mailer.rb:14:in `add_inline_attachment!' So clearly the type_for method is being called on a class instead of an object. Here is how I add the inline attachment, it follows the guidelines from ActionMailer: attachments.inline['photo.png'] = File.read('path/to/photo.png') I have tested that the file