을 거치지 않고 파셜 내에서 렌더링, 나는 각 템플릿에 대해 별도의 부분을 렌더링 다음 부분 지문 내에서내 도우미 메서드에서 지역 변수
structure=""
if(@page.theme_set = 1) #line 1
render :partial => "first_theme.html", :locals => {:structure => structure}
else
render :partial => "second_theme.html", :locals => {:structure => structure}
end
concat(structure) #line 2
, 나는이 작업을 수행;
<% structure << header %>
<% structure << content_for_first_theme %>
<% structure << footer %>
3 가지 모두가 도우미의 메소드입니다. 그러나 1 행과 2 행을 부분으로 이동하면 구조가 렌더링되지 않습니다. 부분 변수에 로컬 변수를 초기화하고 전달하는 대신 부분 변수 내에서 렌더링하는 것을 원하지 않습니다. 내가 어디로 잘못 가고 있니?