【发布时间】:2017-06-12 16:20:55
【问题描述】:
我有一个带有一些集合的 rails 应用程序,我想将它们设置为流星应用程序上集合的源。
据我了解,我可以通过这样做从流星连接到。
var remote = DDP.connect('http://127.0.0.1:5000');
Customers = new Meteor.Collection('customers', remote);
remote.subscribe('customers', function() {
var customers = Customers.find();
console.log(customers.count());
});
对于流星部分来说这似乎很简单,但是我一直无法弄清楚如何采用 rails 模型并将其公开为出版物。
我在这里找到了 ruby-ddp-client https://github.com/knubie/ruby-ddp-client 并查看了此处给出的示例http://www2.bindle.me/blog/index.php/726/augmenting-meteor-plugging-gaps-with-external-services,我仍然不明白如何使用上述示例公开一个简单的导轨模型。
任何帮助将不胜感激。
【问题讨论】:
标签: ruby-on-rails meteor ddp