我用线创建一个模型
rails g scaffold contact firstname:string lastname:string email:string
但是属性应该是这样的
first_name:string
代替?
解决方法
公约不是一成不变的,但遵循它们是很好的.
是的,广泛传播的属性名称约定是snake case.
Snake case:
punctuation is removed and spaces are replaced by single underscores. Normally the letters share the same case (either UPPER_CASE_EMBEDDED_UNDERSCORE or lower_case_embedded_underscore) but the case can be mixed.