1

Is it possible to render a partial view in Geddy.js without rendering the entire HTML page layout?

self.respond(model, {layout: false, template: 'app/views/users/_list'});

I've tried to do this with no success. (Although the documentation says: "layout [false]: a flag to not use a layout file")

4

2 回答 2

1

为了将来参考,您可以传入false布局,它不会使用文件中的布局。

http://geddyjs.org/documentation#controllers.respond

于 2013-06-25T07:22:16.573 回答
0

好的。我终于做了一个“空”的布局,叫做empty.html.ejs

<%- yield(); %>

然后我在适当的控制器操作中像这样使用它:

..., {layout: 'app/views/layouts/empty', ...

这似乎是一个黑客,但至少它是一个有效的解决方案......

于 2013-01-19T13:42:10.480 回答