Skip to content

Instantly share code, notes, and snippets.

@ahmdrefat
Created April 23, 2012 14:07
Show Gist options
  • Save ahmdrefat/2471102 to your computer and use it in GitHub Desktop.
Save ahmdrefat/2471102 to your computer and use it in GitHub Desktop.
Generating new models
# run first
rails g model course name:string description:text university:string lectures_counter:integer
# and then
rails g model lecture name:string description:text youtube_url:string course_id:integer
# and then
rails g model enrollment course_id:integer person_id:integer
# and then run the database migration to create the tables
rake db:migrate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment