1
テンプレート内のレンダリング機能でモジュール名を動的に選択したいと考えています。だから私はこれを試してみましたが、私はエラーを取得しています:レンダリング機能でモジュール名を動的に変更する方法
<%= render if i.compType == "mod" do MyProj.ModuleView else MyProj.ComponentView end, i.compName %>
最終的な結果は次のようになります。
<%= render MyProj.ModuleView, "module.html" %>
または
<%= render MyProj.ComponentView, "component.html" %>
それを行うための最善の方法は何ですか?