簡體   English   中英

Rails和Neo4j的API分頁

[英]API pagination with Rails and Neo4j

我正在使用Rails和Neo4j.rb構建REST API,我需要對一些響應進行分頁。 首先,我嘗試使用neo4j-will_paginate gem,但是執行bundle install時出現以下錯誤:

Bundler could not find compatible versions for gem "activesupport":
  In Gemfile:
    neo4j-will_paginate (>= 0) ruby depends on
      activesupport (~> 3.0) ruby

    devise-neo4j (~> 2.0.0.alpha.1) ruby depends on
      neo4j (>= 3.0.0.alpha.6) ruby depends on
        activesupport (4.0.0)

Bundler could not find compatible versions for gem "neo4j":
  In Gemfile:
    neo4j (~> 3.0.0) ruby

    devise-neo4j (~> 2.0.0.alpha.1) ruby depends on
      neo4j (3.0.0.alpha.6)

我如何在不刪除依賴項之一的情況下進行修復?

除此之外,包括分頁的正確方法是什么:標頭或以JSON呈現? 考慮到我將在Ember應用程序中使用響應,哪種方法更合適?

最好的祝福!

首先,我認為您應該使用gem的3.0.x版本(而不是發行候選版本),因為它已經超出rc一段時間了,並且已經應用​​了許多補丁程序。

第二,我們制作了一個單獨的neo4j-will_paginate gem,因為我們無法訪問rubygems上的原始文件:

https://github.com/neo4jrb/neo4j-will_paginate_redux

那可能有幫助

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM