我有这个:
<h1 class="left"><%= pluralize @player_to_team_histories_count.count, "Player" %> Found
(注意“发现”一词的补充)
我如何用haml做到这一点?
%h1.left= pluralize(@player_to_team_histories_count.count, "Player") Found
抱怨Found
不是定义的常量
答案 0 :(得分:1)
哎呀,问问,你会明白的:
%h1.left= "#{pluralize(@player_to_team_histories_count.count, 'Player')} Found"