简体   繁体   English

如何使用geddy将模型加载到控制器中

[英]How to load model in to controller with geddy

I have a Locations controller and Location model I want to use the the Location model in another controller but calling 我有一个Locations控制器和Location模型,我想在另一个控制器中使用Location模型,但调用

geddy.models.Locations.all(...);

does not work. 不起作用。 It says Locations is undefined. 它说位置是不确定的。

How do I make it load the model manually? 如何使其手动加载模型? Or should I create a function in the Locations controller to grab the data using a request on the client or a call directly to the controller on the sever? 还是应该在Locations控制器中创建一个函数,以使用客户端上的请求或在服务器上直接调用控制器来获取数据?

看起来您应该在单数形式的复数个LocationsLocation -希望这会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM