Strategy for using outside Rails controllers like grape?
rromanchuk opened this issue · 1 comments
I love using this gem with pghero
, but i'm wondering the best way to make use of customizing my my own component to use outside of a rails controller, in my case it's grape.
I know i can add my own component, and in my case, grape offers env["api.endpoint"]
https://github.com/ruby-grape/grape#current-route-and-endpoint but i'm not sure what the best way to pass this information in from what i believe requires a grape middlewear from Grape::Middleware::Base
You can go ahead and close this, just seeking advice, improving SEO for others. Or maybe there is a simpler solution as this has most likely aged.
You could probably do something similar to the actioncontroller instrumentation:
Lines 109 to 126 in b04051c
marginalia/lib/marginalia/comment.rb
Lines 10 to 12 in b04051c
marginalia/lib/marginalia/comment.rb
Lines 94 to 104 in b04051c
Good luck!