为什么 content_for html 没有在 page.html 中呈现?

发布于 2024-12-26 22:37:40 字数 258 浏览 2 评论 0原文

我正在尝试测试在访问的控制器操作视图中在 content_for 中呈现的选择器。

我注意到,当我调试 page.html 时,我看不到通过 content_for 渲染到产量中的内容,相反,我只看到最初位于 application.html.haml 中的 html。

是否需要等待页面完全加载? 我正在使用: let(:page_view) { Capybara::Node::Simple.new(@response.body) }

有什么想法吗?

I am trying to test a selector that is rendered within content_for in the view of visited controller action.

What I've noticed is that when I debug page.html, I don't see the content that is rendered into yields via content_for, instead, I see only the html that is originally in the application.html.haml.

Is it a matter of waiting for page to get fully loaded ?
I am using:
let(:page_view) { Capybara::Node::Simple.new(@response.body) }

Any idea please ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

噩梦成真你也成魔 2025-01-02 22:37:40

你有进入你的班级吗

render_views 

Do you have into you class

render_views 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文