The 
  rack-contrib
  
    Show archive.org snapshot
  
 gem brings a JSONP middleware that just works™. Whenever a JSON request has a callback parameter, it will wrap the application's JSON response appropriately.
The project is a bit dated, but the JSONP middleware is ok.
Posted by Dominik Schöler to makandra dev (2017-01-25 08:05)