어떤 이유로 인해 부분적으로 content_for
블록을 렌더링 할 수 없습니다.부분 렌더링하지 않는 레일 content_for
여기 코드의 다음은 포함되지 않습니다 다음과 같은 몇 가지 이유를 들어
/ => index.html.slim
doctype html
html lang="de"
= render "layouts/headinclude"
body
= yield
- if Rails.env.production?
- content_for :additional_headincludes do
= render "layouts/hotjar"
내 부분 한 번 완전히 렌더링 :
/# => _headinclude.html.slim
head
title= @title || "My Title"
link href='//fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'
- if content_for?(:additional_headincludes)
= yield :additional_headincludes
나는이 작동하지 않을 이유가 표시되지 않습니다. 어떤 도움을 주셔서 감사합니다. 부분을 내 headinclude
-partial에 직접 렌더링 할 때 모두 정상적으로 작동합니다.