查看輸出我有軌傭工(hs_if
,hs_else
):變更軌道從助手
= hs_if :current_user do
Hello, {{ current_user/name }}!
= hs_else do
= link_to 'Sign In', sign_in_path
...產生車把模板:
{{#if current_user}}
Hello, {{ current_user/name }}!
{{else}}
<a href="/signin">Sign In</a>
{{/if}}
我怎樣才能使{{#if current_user}} ... {{else}} ... {{/if}}
沒有嵌套hs_else
hs_if
?
我想我應該從輸出中刪除{{/if}}
,但我無法找到幫助者的方式。
您可以顯示'hs_if'和'hs_else'的代碼? – nathanvda
@nathanvda https://gist.github.com/1156422 –