使用haml在erb行上打印其他信息

时间:2012-09-22 22:59:34

标签: ruby-on-rails haml erb

我有这个:

<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不是定义的常量

1 个答案:

答案 0 :(得分:1)

哎呀,问问,你会明白的:

%h1.left= "#{pluralize(@player_to_team_histories_count.count, 'Player')} Found"