It would be nice if there would be a helper for getting the path of the current endpoint, like:
class ExampleAPI < Grape::API
version 'v1'
prefix 'api'
format 'json'
resource :cats do
get '/' do
current_path # returns the same thing as api_v1_cats_path
end
end
resource :dogs do
get '/' do
current_path # returns the same thing as api_v1_dogs_path
end
end
end
My use case would be constructing pagination links. For that I always need to get the path of the current endpoint being used and add some query parameters to it.
It would be nice if there would be a helper for getting the path of the current endpoint, like:
My use case would be constructing pagination links. For that I always need to get the path of the current endpoint being used and add some query parameters to it.