を通過せずにパーシャル内からレンダリング、私はテンプレートごとに別々の部分をレンダリング:パーシャル以内私のヘルパーメソッド内のローカル変数
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を部分に移動すると、構造はレンダリングされません。部分変数にローカル変数を初期化して渡すのではなく、部分変数内からレンダリングしたいと思います。どこが間違っていますか?