context
when I try to do an inline image attachment with actionmailer it throws the following error
undefined method `url' for nil:NilClass
code
in mailer
def inline_image(image_name)
attachments.inline[image_name] = File.read())
end
def shared_user_email()
inline_image(image_name_string)
mail(to: email, subject: whatever)
end
in template
<%= image_tag attachments[image_name].url %>
in controller
UserMailer.delay.shared_user_email()
tried
Tried using a specific hash (Rails attachments inline are not shown correctly in gmail)
Tried setting the content_Id (Rails mailer error with inline attachment)
No dice.