Rails attachments inline are not shown correctly in gmail

After all i found a solution: all you need to do is set the mime-type and encoding of the attachment. attachments.inline[‘blank’] = { :data => File.read(“#{Rails.root.to_s + ‘/app/assets/images/blank_500x500.png’}”), :mime_type => “image/png”, :encoding => “base64” } attachments.inline[‘discount-deal-triangle’] = { :data => File.read(“#{Rails.root.to_s + ‘/app/assets/images/discount-deal-triangle.png’}”), :mime_type => “image/png”, :encoding => “base64” } That did the trick for … Read more

How do I set up email confirmation with Devise?

1. Make sure you include confirmable in Model.devise call class User < ActiveRecord::Base devise :database_authenticatable, :confirmable … end 2. Make sure you add confirmable to the user migration create_table :users do |t| t.database_authenticatable t.confirmable … end If you’re using devise 2.0+ this fails because devise no longer provides migration helpers, and so t.confirmable raises an … Read more

Heroku/devise – Missing host to link to! Please provide :host parameter or set default_url_options[:host]

You need to add this to your environment.rb config.action_mailer.default_url_options = { :host => ‘localhost’ } Make sure you change host to your production url and keep it localhost for development. This is for the mailer, it needs a default email to send out notices such as confirmations etc… You should check the logs on the … Read more