hi just trying to create a qr code in my rails website using sam vincents qr code generator https://github.com/samvincent/rqrcode-rails3....... first i added this code to a controller
class QrcodeController < ApplicationController
def qrcode respond_to do |format|
format.html
format.svg { render:qrcode => @qrurl, :level => :l, :unit => 10, :color => black }
format.png { render :qrcode => @qrurl } format.gif { render :qrcode => @qrurl } format.jpeg { render :qrcode => @qrurl } end enddef options {:qrcode => "http://helloworld.com", size => 4} end
end
then i am not sure what to add in the view i tried this
<div class="Qrcode qr">
<h2>Qr code</h2>
<p><%= link_to "SVG", Qrcode_path("svg") %></p>
<p><%= link_to "PNG", Qrcode_path("png") %></p>
<p><%= link_to "JPEG", Qrcode_path("jpeg") %></p>
<p><%= link_to "GIF", Qrcode_path("gif") %></p>
would appreciate any help on how it works as their are not that many instructions online im using ruby 1.9.3 and rails 4.0.1