2011-08-17 10 views

答えて

1

@taxonの値がクラス名であると推測していますか?もしそうなら、これはあなたのために働くはずです。

- taxon_class = (@taxon && ([@taxon] + @taxon.ancestors).include?(taxon)) ? @taxon : "current" 
%li{:class => taxon_class} 

私は常に、haml {}の括弧の外でルビーロジックを行うほうが簡単です。

関連する問題