Rails

Jason Rudolph presents a Refactotum session on contributing to open source at the innaugural 2GX Groovy/Grails Experience in early 2008.

Jason Rudolph presents a Refactotum session on contributing to open source at the innaugural 2GX Groovy/Grails Experience in early 2008.

Photo courtesy JS Bournival. Used with Permission.

Contact us to schedule training for your team:

100 Europa Drive Suite 495 Chapel Hill, NC 27517
phone 919.442.3030 fax 919.968.7210
info@thinkrelevance.com

Ruby on Rails is a tremendously productive environment for building web applications. Many frameworks provide Model/View/Controller (MVC) and Convention over Configuration, but Rails does it with particular grace.

In this course you will learn to take full advantage of Ruby on Rails, based on the experience of a team that has shipped dozens of web applications. We will show you how to

  • quickly build applications in Rails
  • use the Ruby language to add advanced features
  • apply test-driven development to ensure quality and maintainability
  • dive into the Rails codebase itself for under-the-hood knowledge

Course length:

5 days

Class size:

Up to 18

Supplied Materials:
Prerequisites:
  • Experience in a modern programming language (not necessarily Ruby)
  • Familiarity with HTML and the Web
Setup:

Students:

  • Computer with Ruby and Rails installed
  • Editor or IDE of student’s choice
  • Internet access

Instructor:

  • Computer with Ruby and Rails installed
  • Projector

Module Outline

1. Exploring Ruby

  • irb
  • Ruby documentation
  • a few core classes
  • reflection
  • encapsulation
  • inheritance
  • unit testing

2. Collections, Strings, and a Little Metaprogramming

  • iteration
  • blocks
  • open classes
  • method_missing
  • define_method
  • regular expressions
  • string and array methods

3. Processing Data in Ruby

  • *args
  • gets
  • chomp
  • strings and symbols
  • to_s and to_sym
  • libraries
  • date

4. Ruby Idioms

  • lots of literals
  • modules
  • reflection revisited
  • closures, procs, and blocks
  • ranges
  • case equality
  • exception handling

5. Intro to Rails

  • what is Rails?
  • MVC
  • creating an application
  • directory structure
  • support scripts
  • log files
  • validation

6. Migrations

  • migrating tables
  • migrating columns
  • migrating indexes
  • SQL migrations
  • Rails 2.0 sexy migrations
  • managing the schema version

7. ActiveRecord

  • gems
  • getting connected
  • CRUD
  • validations
  • lifecycle methods
  • transactions
  • magic columns

8. Testing Models

  • types of tests
  • unit testing
  • assertions
  • testing exceptions
  • testing validations
  • using fixtures
  • refactoring tests

9. ActiveRecord Relationships

  • has_one, belongs_to, has_many, habtm
  • generated methods
  • relationship options
  • :through and polymorphic relationships
  • acts_as_list, acts_as_tree
  • when instances get saved

10. Rake

  • Domain-Specific Languages (DSLs)
  • rake, ant, and make
  • rake command line options
  • common tasks
  • writing your own tasks
  • namespaces
  • adding tasks to a Rails application

11. ActionController

  • actions
  • params, session, and flash
  • render or redirect?
  • filters and verify
  • routing
  • named routes

12. Testing Controllers

  • functional and integration testing
  • request methods
  • assert_response and assert_redirect
  • asserting assigns
  • the mighty assert_select
  • decoupling tests from model layer
  • rcov

13. ActionView

  • render options
  • ERB
  • Builder
  • layouts
  • partials
  • Rails helpers
  • writing your own helpers

14. Ajax on Rails

  • prototype
  • ajax helpers
  • observing forms and fields
  • scriptaculous
  • autocomplete
  • drag and drop
  • RJS

15. Caching

  • page caching
  • action caching
  • fragment caching
  • query caching
  • profiling
  • benchmarking
  • log analysis