0

我有下表:

# views/students/index.html.haml
%table.table
  %thead
    %tr
      %th=t :first_name  # doesn`t work
      %th=t '.last_name' # works
  %tbody
    - @students.each do |s|
      %tr
        %td=s.first_name
        %td=s.last_name

这是我的语言环境文件:

pl:
  students:
    index:
      first_name: "Imię"
      last_name: "Nazwisko"

可以使用符号而不是字符串 '.first_name' 吗?

4

1 回答 1

2

它可以使用:'.first_name'(我假设您所指的“符号”是句号)

于 2012-10-31T08:28:10.833 回答