This document provides an overview of the Ruby programming language and the Ruby on Rails web application framework. It discusses key features of Ruby like being object-oriented, dynamic, and readable. It then explains what Rails is and some of its core components like ActiveRecord, ActionPack, and ActiveSupport. The document also demonstrates how to work with models, database relationships, and migrations in Rails.
6. “Ruby on Rails is astounding. Using it is like
watching a kung-fu movie, where a dozen
bad-ass frameworks prepare to beat up the
little newcomer only to be handed their
asses in a variety of imaginative ways.”
Nathan Torkington
7. “Powerful web applications that
formerly might have taken weeks or
months to develop can be produced
in a matter of days.”
Tim O'Reilly
21. > animals = %w{dog cow ox chicken goose goat
cow dog rooster llama pig goat dog cat cat dog
cow goat goose goose ox alpaca}
> puts quot;The farm has quot; + animals.en.conjunction
=> “The farm has four dogs, three cows, three
geese, three goats, two oxen, two cats, a
chicken, a rooster, a llama, a pig, and an
alpaca”
22. class ReverseString
def method_missing(method_name)
return method_name.to_s.reverse
end
end
> s = ReverseString.new
> s.Hello_World
=> “dlroW_olleH”
41. “The essence of an Active Record is a domain
model in which the classes match very closely
the record structure of an underlying database.
Each active record is responsible for saving and
loading to the database and also for any domain
logic that acts on the database”
Martin Fowler
42. ActiveRecord ActionPack
Model View & Controller
MySQL
PostgreSQL
ActiveSupport JavaScript Libraries
MS SQL - ADO Prototype & Script.aculo.us
MS SQL - ODBC
Oracle
ActionMailer ActionWebService
SQLite
DB2