I'm new to Ruby, and my task is to add pagination for the get method, but I try to test if the params (page) and(per_page) exist, if they dont exist it should return all the data in the database, because by defaulkt kaminari return only the 25 page.
this is my function
def index
if page.present? && per_page.present?
@domains = Domain.accessible_by(access_token).page(page).per(per_page)
else
@domain = Domain.accessible_by(access_token).all
end
render json: @domain
end
at it return a 200 OK
response but null