mime types - Cannot add inline attachment with actionmailer in rails 3 -


after bundle install no longer able add inline images attachments. error get:

nomethoderror (undefined method `type_for' mime::types:class):   app/mailers/welcome_mailer.rb:14:in `add_inline_attachment!' 

so type_for method being called on class instead of object.

here how add inline attachment, follows guidelines actionmailer:

attachments.inline['photo.png'] = file.read('path/to/photo.png') 

i have tested file indeed exists , gets read. issue appears gem-related.

upgrade mime-types 3.1, released on 22 may 2016. mime-types 2.x has 6 more planned updates , reaches end of life in november 2017, after point no more support provided @ all.


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -