Skip to content

Instantly share code, notes, and snippets.

View samarthasthana's full-sized avatar
🏠
Working from home, f4vr 🌮

Samarth Asthana samarthasthana

🏠
Working from home, f4vr 🌮
View GitHub Profile

Ruby on Rails coding standard

{{toc}}

Code style

  • Use UTF-8. It’s 21 century, 8bit encodings dead now.
  • Use 2 space indent, not tabs
  • Use Unix-style line endings
  • Keep lines not longer than 80 chars

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one