Im creating a model with the line
rails g scaffold contact firstname:string lastname:string email:string
But should the attributes be like
first_name:string
instead?
Conventions aren't set in stone, but it's good to follow them.
And yes, widely spread convention for attribute names is 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With