This is a demo for the combine_pdf gem - a pure ruby solution that helps you merge, combine, index PDF files and more.
This demo runs on the Plezi ruby web-app framework, which is very easy to use and supports native Websockets (much like socket.io for node.js).
Porting the code into your Rails project should be easy, but might require some minor adjustments.