'Create a QR generator API for Ruby (2.2.2) on Rails

I have a main Ruby on Rails app, which generates links and associated PDF files. What I want is to generate a QR code for each one of the links, so I can paste them in the PDF files.

I know the rqrcode gem, but my problem is that the app is in Ruby 2.2.2, and the gem works from version 2.3 on. I can´t update the Ruby version for irrelevant reasons, so that´s not an option. So I want to create an API to which I pass the link, and it returns me the QR code via JSON. This API will be in Ruby 3.1.2 so I can use the rqrcode gem. The thing is that in every RoR API tutorials, they configure the storage and many other things that I think are not necessary in my case. I want to make this API as minimal as possible, and I don't know where to start.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source