0
我已经在YAML文件中的以下数组:检索阵列数据红宝石
error_messages:
- 'Error! There is no registration number'
- 'Error! Event is not added'
我从这个文件中读取数据如下:
$common_test_data['error_messages[0]']
我初始化我YAML文件在全球变种:
$common_test_data = YAML.load_file("#{Dir.pwd}/test_data/common_data.yml")
但不幸的是数据不会从yaml数组检索。也许有具体的方法来从yaml文件检索数据?
它解决了!谢谢! –
然后你可以选择我的unswer作为解决方案:-) – Nikolai
我的声望太低了,对不起) –