`

how to generate qrcode on ror

阅读更多

   1. In your rails project, install the plugin by following command:

       ./script/plugin install http://qrcode-rails.googlecode.com/svn/trunk/plugins/qrcode

   2. Add javascript include tag in HTML header:

         <%= javascript_include_tag :defaults %>

   3. Add following funtion to where you want to generate QRCode.

         <%= qrcode('http://www.google.com/', 2) %>

          * The first parameter is URL
          * The second optional parameter is pixel size.
   4. Done!

For details, please check the QRCode project page.

Sample Code
<%= qrcode('http://www.google.com/', 8 ) %>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics