【发布时间】:2015-02-13 15:00:07
【问题描述】:
我正在尝试弄清楚如何在 HAML 中编写 link_to_if 助手和 do 块的使用。
我试过这个但它产生了一个错误:
= link_to_if(test, my_text, my_path) do
- some_other_text
错误:syntax error, unexpected ';', expecting ')' end;_hamlout.buffer << _hamlout.f...
我知道我可以使用 if else 语句和 link_to 帮助器达到相同的结果,但我想了解如何使用 link_to_if 来实现。
【问题讨论】:
标签: ruby-on-rails-3 haml view-helpers