刚刚从3.0.7升级到3.2.8;部分未显示

时间:2012-09-14 18:49:31

标签: ruby-on-rails ruby-on-rails-3 ruby-on-rails-3.1 ruby-on-rails-3.2

我刚刚从3.0.7升级到3.2.8,并且没有显示一堆部分。但是,它们正在呈现(根据日志),并且没有给出错误消息。这是一个(简化)示例:

布局/ application.html.haml

(snip)
%body
  = yield :header
  = yield
(snip)

主/ index.html.haml

- content_for :head do
  (snip)

- content_for :header do
  (snip)

= render(:partial => "home_content", :layout => "shared/layouts/content_columns")

共享/布局/ _content_columns.html.haml

%div
  .content
    = yield :content_column
  .sidebar
    = yield :sidebar

主/ _home_content.html.haml

- content_for :content_column do
  = render_external("twitter")
  = render(:partial => "seo_content")

- content_for :sidebar do
  = render(:partial => "featured")
  = render(:partial => "testimonials")
  = render(:partial => "social")

显示:head:header的所有内容,而:content_column:sidebar内容均不显示。我想通过使用布局渲染部分来改变一些东西,但是一些快速搜索并没有产生任何明显的效果。

谢谢!

更新

以下是日志中的呈现顺序(包括shared/layouts/_content_columns.html.haml中包含的调试语句):

Rendered home/_twitter.html.haml (1.4ms)
Rendered home/_seo_content.html.haml (0.9ms)
Rendered home/_featured.html.haml (2.2ms)
Rendered home/_testimonials.html.haml (2.1ms)
Rendered home/_social.html.haml (213.8ms)
DEBUG: String="Rendering shared/layouts/content_columns"
DEBUG: String="At '= yield :content_column'"
DEBUG: String="At '= yield :sidebar'"
Rendered home/_home_content.html.haml (256.9ms)
Rendered home/index.html.haml within layouts/application (300.6ms)

如您所见,部分内容正在home_contentindex之前呈现,因此其内容应由= yield中的layouts/application抓取

0 个答案:

没有答案