title: Rails 4: Getting QRCode to display in email via action mailer
body: <p>my problem is to get my QRCode to display in the email sent via action mailer in rails.
  I am currently using the gem 'rqrcode_png' <br>
  I have read through some guides and it states inline attachment. However, I did not save the QRCode generated in my own files. </p>
  
  <p>Is there a way to display the QRCode in the email without having to save it in my database?
  Also, I have tried the following code on my view page and it works, but it does not work when I copy it to my action mailer code. It only shows the <strong>QR Code for venue</strong>.<br>
  Here is my code below for the displaying of QRCode. Thank you!</p>
  
  <pre><code>&lt;p&gt;
    &lt;% @deal.venues.each do |venue| %&gt;
    &lt;strong&gt;QR Code for &lt;%= venue.neighbourhood %&gt;&lt;/strong&gt;&lt;br&gt;
    &lt;% @qr = RQRCode::QRCode.new(@deal.id.to_s + "_" + venue.id.to_s + "_" + @deal.created_at.to_s).to_img.resize(100, 100).to_data_url %&gt;
    &lt;span&gt;&lt;%= image_tag @qr %&gt;&lt;br&gt;&lt;/span&gt;
    &lt;% end %&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p><strong>Solution by Lewis Buckley with some edits</strong></p>
  
  <p>I made some edits to the code and now it is working. As, I am using ruby i have to place &lt;%= %> around the variables in order to display them.</p>
  
  <pre><code>&lt;img src="https://chart.googleapis.com/chart?chs=150x150&amp;amp;cht=qr&amp;amp;chl=&lt;%= @deal.id.to_s + '_' + venue.id.to_s + '_' + @deal.created_at.to_s%&gt;" alt="QR code"&gt;
  </code></pre>