渲染图部分展示
我在自定义活动管理方面相处得很好,但我无法让它工作:
在 app/admin/orders.rb 中我有
show do
render "show"
end
在 app/views/admin/orders/_show.html.erb 中我只是
<h3>Test</h3>
<% panel "General" do %>
<% end %>
现在h3 Test 渲染得很好,但空面板“常规”渲染在页面顶部!
所以我变得
<div class="panel">
<h3>General</h3>
<div class="panel_contents"></div>
</div>
<!DOCTYPE html><html>
...
非常奇怪......
谢谢,我真的很感激对此的一些帮助!
I am getting along really well with customizing active admin, but I can't get this to work:
In app/admin/orders.rb I have
show do
render "show"
end
In app/views/admin/orders/_show.html.erb I simply have
<h3>Test</h3>
<% panel "General" do %>
<% end %>
Now the h3 Test is rendered just fine but the empty panel "General" gets rendered on top of the page!
So I get
<div class="panel">
<h3>General</h3>
<div class="panel_contents"></div>
</div>
<!DOCTYPE html><html>
...
Very strange...
Thanks, I would really appreciate some help on this one!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ActiveAdmin 的文档提到在
show
块中渲染,显然它应该有效。也许您应该在项目的 GitHub 页面中提出问题?编辑:嘿,也许问题源于部分的名称。您是否尝试过以不同的方式命名部分,即。不是“展示”?
顺便说一句,您尝试过使用捕获吗?也许它会有所帮助。不过还没有测试过。
The ActiveAdmin's docs mention render in
show
blocks and apparently it is supposed to work. Maybe you should file an issue in the project's GitHub page?EDIT: Hey, maybe the issue stems from the name of the partial. Have you tried naming the partial differently, ie. not "show"?
And btw, have you tried using
capture
? Maybe it could help. Haven't tested it, though.