-
Notifications
You must be signed in to change notification settings - Fork 9
Macro::LinksBuilder
Vladislav Trotsenko edited this page Sep 27, 2019
·
2 revisions
Provides to proxy resource path to Service::JsonApi::Paginator
and sets composed links into context follow Jsonapi specification. Dependent from Api::V1::Lib::Operation::Pagination
.
resource_path
should be an existing url_helper (Rails.application.routes.url_helpers
)
class SomeOperation < ApplicationOperation
step :set_model
step Subprocess(Api::V1::Lib::Operation::Pagination) # sets ctx[:pagy]
step Macro::LinksBuilder(resource_path: :some_path)
step Macro::Renderer()
end
class SomeOperation < ApplicationOperation
step :set_model
step Subprocess(Api::V1::Lib::Operation::Pagination) # sets ctx[:pagy]
step Macro::LinksBuilder(resource_path: :some_path, ids: %i[resource_name_id])
step Macro::Renderer()
end
RubyGarage is a leading software development and consulting company in Eastern Europe. Our main expertise includes Ruby and Ruby on Rails, but we successfully employ other technologies to deliver the best results to our clients. Check out our portfolio for even more exciting works!