Barby is a great gem for generating a barcode or QR code. You can choose to output it as any number of barcode types or as a QR code. This example will use a QR code but I have successfully used the Code128 barcode which is fairly common in the retail space.
Add Barby to your gem file:
1 2 |
|
Here is an example helper for generating the QR code as base64 encoded png data:
1 2 3 4 5 6 7 8 9 10 |
|
And an example call from your view:
1
|
|
So far so good, That’s it!!! See ya!!! :)