A Ruby hash (or associative array) is a data structure that allows you to define the key for storage (instead of a simple numerical index).
Ruby散列表(或关联数组)是一种数据结构,允许您定义用于存储的键(而不是简单的数值索引)。
To represent the above foreign key relationship in Ruby on Rails, you will have to create an association between the models.
你需要在模型之间创建关联才能够在Rubyon Rails中表示外键。
But for all the diversity of Ruby on Rails applications, the ones that are best-suited to the framework have a few key things in common.
但是这么多不同的Rubyon Rails应用程序,有几个重要的共通最适关键。
For this purpose, you use the hash class in Ruby, which allows you to create key-value pairs (in what appears to be an array), but then easily reference them later by key.
为此,您可以使用Ruby中的hash类,它允许您创建键值对(类似于数组),但是随后可以轻松地通过键引用它们。
What is its main design philosophy and what are its key design principles behind Ruby?
什么是其主要的设计理念和什么是其主要设计原则,红宝石?
What is the key factor that makes Ruby so popular nowadays?
什么是关键因素,使得如今的Ruby如此受欢迎?
What is the key factor that makes Ruby so popular nowadays?
什么是关键因素,使得如今的Ruby如此受欢迎?
应用推荐