Skip to content

Instantly share code, notes, and snippets.

View TheCrott's full-sized avatar
🎯
Focusing

Muhammad Aldo Firmansyah TheCrott

🎯
Focusing
  • Jakarta
View GitHub Profile
@TheCrott
TheCrott / rails_activerecord_cheatsheet.md
Created February 3, 2016 19:09 — forked from amejiarosario/rails_activerecord_cheatsheet.md
Rails ActiveRecord (association) - Cheatsheet

Rails ActiveRecord (association) - Cheatsheet

http://guides.rubyonrails.org/association_basics.html

Types of associations

  • belongs_to : TABLE_NAME
  • has_one : TABLE_NAME [:through => :TABLE_NAME]
  • has_many : TABLE_NAME [:through => :TABLE_NAME]
  • has_and_belongs_to_many : TABLE_NAME [:join_table => :TABLE_NAME]
@TheCrott
TheCrott / index.md
Last active March 5, 2018 11:03 — forked from rstacruz/index.md
Rails models cheatsheet

ActiveRecord Cheatsheet Online

http://slash7.com/cheats/activerecord_cheatsheet.pdf
http://appletree.or.kr/quick_reference_cards/Ruby-Ruby_on_Rails/rails-migrations.pdf

Rails Models

Generating models

$ rails g model User