`
siuying
  • 浏览: 90893 次
  • 性别: Icon_minigender_1
  • 来自: 香港
最近访客 更多访客>>
社区版块
存档分类
最新评论

Ruby on Rails plugin: QRCode

    博客分类:
  • Tech
阅读更多

I come across this page, a javascript QRCode generator. 1

To simplify the tasks to use it in Rails, I created a plugins QRCode for Ruby on Rails.

Usage

  1. In your rails project, install the plugin by following command:
  2.  ./script/plugin install http://qrcode-rails.googlecode.com/svn/trunk/plugins/qrcode
  3. Add javascript include tag in HTML header:
  4.    <%= javascript_include_tag :defaults %>
  5. Add following funtion to where you want to generate QRCode.
  6.    <%= qrcode('http://www.google.com/', 2) %>
    • The first parameter is URL
    • The second optional parameter is pixel size.
  7. Done!

For details, please check the QRCode project page.

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

Sample Screen


  1. In case you dont know, QRCode is those mystic code appeared in most japanese media. Snap the QRCode by your cell phone, the code is translated into URL.
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics