Awesome
goqr
QR codes for ruby/rails using goqr.me API
Installation
Add it to your Gemfile and run the bundle
command:
gem 'goqr'
Getting started
In rails, you can generate a QR code just using the goqr
helper method:
<%= image_tag goqr(data: 'Hi! goqr is awesome!', size: '128x128') %>
Available options
All available options are the specified by goqr API documentation.
Gotchas
- If you want to generate a QR code just for text or urls, use the data parameter normally:
<%= image_tag goqr(data: 'Just text') %>
<%= image_tag goqr(data: 'http://patriciomacadden.com.ar') %>
- If you want to generate a QR code for phone numbers, just prepend
TEL:
in the data parameter:
<%= image_tag goqr(data: 'TEL:+542211234567') %>
- If you want to generate a QR code for SMSs, just prepend
SMSTO:
in the data parameter, separating the phone number and the text by a:
:
<%= image_tag goqr(data: 'SMSTO:+542211234567:Hi!') %>
Contributing
- Fork it
- Create a branch (
git checkout -b my_awesome_branch
) - Commit your changes (
git commit -am "Added some magic"
) - Push to the branch (
git push origin my_awesome_branch
) - Send pull request