I'm trying to implement a hypermedia API using Grape installed directly on top of a rack. Grapes support presenters (“entities”), which seem to be a suitable place to provide all related hypermedia.
If I had a Rails router, I could just pick a route around his ears and drop it into the lead logic. For example ( ROAR ):
link :self do article_url(self) end
But the grapes themselves do not provide easy access to routes, since they do not have names or aliases similar to article_url .
Has anyone encountered a similar problem with Grapes or Sinatra? Is there a simple and easy way to expose resource links?
source share