DCarper/rqrcode_png — Issue #1: Serving the PNG file in a Rails view?
Author: mrichman
Created: 2011-10-08 19:09:39+00:00
State: open

How would I serve up the generated PNG file from a Rails view?

This works using the HTML table method described in rqrcode, but I'd rather use your PNG version:

```

require 'rqrcode'

class UsersController < ApplicationController
before_filter :authenticate_user!

def show
@user = User.find(params[:id])
@qr = RQRCode::QRCode.new('http://www.google.com/')
end

end

<% @qr.modules.each_index do |x| -%>

<% @qr.modules.each_index do |y| -%>
<% if @qr.dark?(x,y) -%>

<% else -%>

<% end -%>
<% end -%>

<% end -%>