2. What is Ruby on Rails? MVC Framework for building web apps in Ruby Uses Ruby classes to abstract out the various components of an app Convention over configuration
5. Basic folder structure apps folder controllers, models, views – where you’ll spend most your time database.yml Configures database Gemfile Configures external libraries used in app
9. ActiveRecord::Base When inherited, maps to table that’s plural of class name Team -> teams Basic methods Team.create() Team.find() Team.where().limit().sort().skip().first Team.where().limit().sort().skip().all
21. What happened? config/routes.rb defines how urls are mapped to controllers get “teams/index” is shorthand for: match “teams/index” => “teams#index”, :via => :get More details: http://guides.rubyonrails.org/routing.html Read comments in config/routes.rb
40. More associations ActiveRecord also has shortcuts for: has_and_belongs_to (join tables) Polymorphic associations (belongs_to different objects) http://guides.rubyonrails.org/association_basics.html
42. Additional Resources Source code for example_app: https://github.com/fuJiin/example_app See it live: http://cg-example-app.heroku.com/teams/index Documentation and light tutorials: http://guides.rubyonrails.org/ More in depth: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book