I'm current using Ruby on Rails 3.2.8 and am trying to send an email using ActionMailer with an image inside of body of the email. I've searched online and none of the instructions help. Here is an example of something I used from a Railscasts episode:
user_mailer.rb
def registration_confirmation(user)
@user = user
attachments["rails.png"] = File.read("#{Rails.root}/public/images/corporate_logo.png")
mail(:to => "#{user.name} <#{user.email}>", :subject => "Registered")
end
registration_confirmation.html.erb
<%= image_tag("corporate_logo.png", :alt => "CorporateLogo") %>
<p><%= @user.name %>,</p>
<p>Thank you for registering!</p>
<p><%= link_to "Edit profile", edit_user_url(@user) %></p>
Thanks!