在我的locales / en.yml中,我有以下内容:
en:
activerecord:
attributes:
ticket:
customer_name: "Customer Name"
inventory:
quantity: 'Quantity'
resources:
quantity: 'Quantity'
hours:
quantity: 'Quantity'
我有没有办法定义字符串' Quantity'作为一个字符串常量,所以我可以在我的en.yml中重复使用常量?
答案 0 :(得分:3)
示例:
default: &default
adapter: mysql2
encoding: utf8
username: username
password: YOURDBPASSWORD
development:
<<: *default
test:
<<: *default