Ruby on rails rails内容\u不显示

Ruby on rails rails内容\u不显示,ruby-on-rails,partial,content-for,Ruby On Rails,Partial,Content For,我在customers/new中有一个:侧边栏部分,我正在屈服于它。节的内容_是从嵌套的分部调用的。文本hello1显示,但hello2不显示 没有抛出错误,我也不知道如何进行故障排除 有什么想法吗 **layouts/application.haml** .container - unless signed_in? = render "custom/account_#{current_account.id}" rescue nil = yield **customers/ne

我在customers/new中有一个:侧边栏部分,我正在屈服于它。节的内容_是从嵌套的分部调用的。文本hello1显示,但hello2不显示

没有抛出错误,我也不知道如何进行故障排除

有什么想法吗

**layouts/application.haml**

.container
  - unless signed_in?
   = render "custom/account_#{current_account.id}" rescue nil
  = yield

**customers/new.haml**

= yield :sidebar

**custom/_account_2.haml**

%p hello1
- content_for :sidebar do
 %p hello2
我相当确定new.haml首先被渲染,然后是局部,最后是布局。首先渲染new.haml是您的问题

- content_for :sidebar do
改为

= content_for :sidebar do

在Hello2It的HAML后面加一个end怎么样?它不需要一个end语句。你能告诉我你在哪里/如何为_account_2.HAML调用render吗?我试着把块的content_放在应用程序的其他部分,仍然没有hello2出现…不,只是打印字符串,=content_for:sidebar do